Merge lp:~edwin-grubbs/launchpad/bug-535430-needspackaging-timeout-part1 into lp:launchpad/db-devel
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Merged at revision: | 9449 | ||||
| Proposed branch: | lp:~edwin-grubbs/launchpad/bug-535430-needspackaging-timeout-part1 | ||||
| Merge into: | lp:launchpad/db-devel | ||||
| Diff against target: |
45 lines (+29/-1) 2 files modified
database/schema/comments.sql (+5/-1) database/schema/patch-2207-56-0.sql (+24/-0) |
||||
| To merge this branch: | bzr merge lp:~edwin-grubbs/launchpad/bug-535430-needspackaging-timeout-part1 | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Stuart Bishop | db | 2010-05-14 | Approve on 2010-05-20 |
| Björn Tillenius (community) | db | 2010-05-14 | Approve on 2010-05-20 |
|
Review via email:
|
|||
Description of the Change
This branch adds the following columns the DistributionSou
total_bug_heat INTEGER
bug_count INTEGER
po_
section INTEGER REFERENCES Section(id)
This table will be used to cache data so the $distroseries/
page won't timeout. A DistributionSou
packages with a SourcePackagePu
The section will be updated by the trigger, since it only needs to be
changed when a new SourcePackagePu
other three columns will be populated by a cronjob.
The total_bug_heat differs from the existing max_bug_heat column in that
the max_bug_heat column is the highest heat value for a single bug related
to the package, and the total_bug_heat is the sum of all the bugs related
to the package.
| Edwin Grubbs (edwin-grubbs) wrote : | # |
| Björn Tillenius (bjornt) wrote : | # |
Ok, removing the trigger makes it easier to keep things sane. How do you intend to keep the other values up-to-date? Maybe it makes sense to rename them, so that it's clear that they are caches only, and might not be correct? Unless you find a way of making sure they are up to date, of course. Also, for the bug values, will it include private bugs as well?
The comments should be added to comments.sql.
| Edwin Grubbs (edwin-grubbs) wrote : | # |
> Ok, removing the trigger makes it easier to keep things sane. How do you
> intend to keep the other values up-to-date?
The other values will be kept up-to-date with a cronjob.
> Maybe it makes sense to rename
> them, so that it's clear that they are caches only, and might not be correct?
> Unless you find a way of making sure they are up to date, of course.
Although I was originally thinking of updating the values with a cronjob, the max_bug_heat is currently updated with a hook in addTask(), so it would be easy to add that. I assume that I could do something similar for po_message_count.
> Also, for
> the bug values, will it include private bugs as well?
Yes.
> The comments should be added to comments.sql.
The comments have been moved.
| Björn Tillenius (bjornt) wrote : | # |
< BjornT> EdwinGrubbs: well, i guess the db patch is fine. you should.
have a talk with deryck, as to whether include private bugs in.
the count, since that might not be desired. also talk to him.
about how to keep the bug heat values up-to-date
< BjornT> EdwinGrubbs: doing it in addTask() only won't be enough
| Stuart Bishop (stub) wrote : | # |
I assume NULL values mean 'has not been calculated yet'. This should be documented in comments.sql.
If we need to retrieve or order rows by bug_count or po_message_count we will need an index on those columns.
Otherwise all looks fine. patch-2207-56-0.sql

After talking with Julian, I have removed the trigger. Updating the DistributionSou rcePackage table when a new SourcePackagePu blishingHistory record is added will instead be handled in lp.soyuz. model.publishin g.PublishingSet .newSourcePubli cation( ).