=== StevenK_ is now known as StevenK === daker_ is now known as daker === infinity1 is now known as infinity === G_ is now known as G === jtv1 is now known as jtv [08:16] Perhaps it is time to bite the bullet and have a generic artifact cross-reference table without strong foreign keys. [08:23] Referential integrity doesn't really buy us much for BugBranch, SpecificationBranch, SpecificationBug [08:23] wgrant: I wrote a weakly-linked table once... TranslatableTemplate or something. Probably gone now, but it was really useful at the time. [08:23] Sometimes with relational databases, painful as it may be, you just have to admit that it's... relational. [08:24] And hi. :) [08:29] jtv: Hi! [08:29] There's SuggestivePOTemplate, but I don't recall TranslatableTemplate. [08:30] (Ahem. Obviously I didn't write a weakly-linked table "once" — I mean I had one in Launchpad once.)) [08:31] Heh [08:31] Dammit, internets, you can deliver my messages within the hour, can't you? [08:44] wgrant: yes, that's the one! [08:45] It eliminated a subquery of a few dozen ms that was repeated in many queries per translation page, but maintaining referential integrity would have defeated the purpose. [08:47] (Actually I've had this long-standing suspicion that those big PO template headers that were only used in one place were unnecessarily slowing down the POTemplate table, but that's another story) [08:47] Yeah, we had that problem with SourcePackageRelease.copyright [08:47] I hacked it to only load when that specific field is requested on the the one page that uses it, saving megabytes of database transfers on hot pages. [08:49] Not to mention decoding... [08:50] I used to want a Django lazy-loading field type for this. But then I got greedier: if we could remove these long strings from the tables altogether, it would increase data density. [08:50] Could matter to lots and lots of joins. [08:50] Indeed, though I suspect most of these would be TOASTed so not affect density much. [08:51] (Even when you're using an index, postgres still needs to look at the actual table to check tuple liveness.) [08:51] True, if they're out in separate storage, that'll help. [08:52] I don't know how the TOASTing works in terms of table representation; POTemplate is so hot for joins that even just dropping a 4-byte field may help. [08:53] cjwatson: Do you think https://bugs.launchpad.net/launchpad/+bug/1170301 is still a problem? Now that everything actually gets closed by copies, Launchpad-Bugs-Fixed may not actually be used in any normal case any more. [08:53] Bug #1170301: It would be nice to have bugs-autoclosing working for intermediate revisions non accepted to the archive but included in a new upload [08:54] jtv: Large values are stored as references to tuples in a separate TOAST relation in a separate file on disk. [08:54] This doesn't help LP as much as it could, as we almost always get all fields. [08:54] But it does mean we're not inflating large dead rows just to check whether they're dead. [08:58] wgrant: Seb filed that bug six months after we switched to proposed-migration and everything being closed by copies ... [08:58] So not sure I'm convinced by that argument [08:59] Hm, indeed. [08:59] Perhaps the ancestry calculation is just dodgy. [08:59] Yeah, I've had my suspicions about that before [09:00] wgrant: I just looked it up... the default TOAST threshold seems to be 2KB, and I suspect most PO headers would hit the "sour spot" just below that. [09:00] In which case, massive potential for moving them out-of-line. :) [09:03] Set only on import, read only on export. [09:12] wgrant: Thanks for reviewing https://code.launchpad.net/~cjwatson/launchpad/livefsbuild-version/+merge/271193, but did you notice that it relies on https://code.launchpad.net/~cjwatson/launchpad/db-livefsbuild-version/+merge/271171 ? [09:43] cjwatson: I reviewed that one, but I guess my request on livefsbuild-version only made it through because closing db-livefsbuild-version got me down to four tabs... [09:43] fixing [09:54] cjwatson: Any thoughts on the cross-artifact link table proliferation? [10:03] wgrant: Limited to only two non-null reference columns? That would make it easier to decide what to do on deletion (e.g. no bug/specification/branch all linked together and then you have to decide what to do if the branch is deleted) [10:04] db-livefsbuild-version> thanks [10:05] cjwatson: Or ditch the dozens-of-columns approach and not bother with FKs. [10:05] what would the table contain then? [10:05] Just store a type and an ID for each end. [10:06] hm, yeah, I guess there's no reason to believe that would have perf problems [10:06] seems reasonable ... [10:06] None whatsoever. [10:06] better density too [10:07] I guess it'd also have a JSON metadata column too, where we'd store eg. the git repo hint. [10:08] in that case it would be a commit sha-1 rather than an id [10:09] no obvious id for the link-to-commit case (unless you use the repo hint as the id, but that complicates what to do on deletion) [10:11] (plus this makes the way toward splitting clearer) [10:11] Right. [10:11] Some kind of identifier [10:12] Not a specifically integral ID. [10:13] Just needs to be some bijective mapping. [10:15] maybe having an id column at least available would be quicker for searching in the cases where we have one [10:15] id integer, identifier json, check (null_count(id, identifier) == 1) or some such [10:16] Maybe. [10:17] A string is only slightly longer, and conversion isn't too verbose or slow. [10:17] I considered using URLs, but that raises issues with staging that I can't be bothered working out this week. [10:20] (this could then be generalised to other services, which could even maybe register callbacks to describe the status of the referenced external artifact to be displayed on the internal artifact's LP page) [10:21] But using simple internal identifiers is a good first step. [10:21] Yeah, ids could have service names attached for splitting [10:22] I like this plan [10:22] That was easier than I expected. [10:22] Are there any cases where inhibiting deletion is more than an inconvenience? [10:23] Not in the tables I'm considering right now. [10:23] I think that this solution should be restricted to those where it shouldn't be inhibited. [10:23] Deleting active MPs, but presumably you aren't looking at that [10:23] Yeah [10:23] Right, no. [10:23] Recipes are a murky case. [10:23] Especially if you're thinking of it being a cross-service thing [10:24] There's a good argument that recipes should be text, and use cross-references for backlinks from branches. [10:24] Due to the fact they can be created by anyone and block deletion of any referenced branch. [10:24] But certainly not an immediate target :) [10:24] Right, I think the path for recipes is to make it possible to detach branches from them after which they become unbuildable but still exist. [10:25] If I get a few solid days to make progress on git recipes then that might be a sensible thing to attempt as part of it. [10:25] Indeed. [10:26] $ git diff --cached --shortstat [10:26] 10 files changed, 4050 insertions(+) [10:26] one of these days [10:27] Impressive. [10:29] I had an otherwise unused train trip === Peng_ is now known as Peng [20:27] morning [21:50] cjwatson, hey :-) I'm a bit confused about the relation between template files and python files. I'm trying to fix #185328, so I understood that +publishinghistory of a package is in soyuz, I found distributionsourcepackage-publishinghistory.pt, and the table I'm lookin for is generated by [21:50] replace="structure publishing/@@+listing-summary"> [21:50] Bug #185328: Publishing history has only distribution series codenames, not version numbers [21:50] I tried to grep a bit these things, but I really don't understand where I'm supposed to look [21:54] early in the file there is tal:define="publications view/batchnav, so I suppose I have to find this view [21:54] but what is it? [23:24] rpadovani: I'm not sure what I think about that bug in general, would probably take some playing around. But as to your specific question, template files are evaluated according to http://pythonic.zoomquiet.io/data/20050615194557/index.html; in general the "context" is model code (i.e. corresponding roughly to a database object) and the "view" is browser code (i.e. the part of the presentation layer that isn't just HTML templating). ... [23:24] ... To find which view is associated with a given template, look for the template in lib/lp/*/browser/configure.zcml - in this case it's in soyuz, and it turns out that the same template may be applied to either lp.soyuz.browser.distributionsourcepackagerelease.DistributionSourcePackageReleasePublishingHistoryView or lp.registry.browser.distributionsourcepackage.DistributionSourcePackagePublishingHistoryView [23:26] rpadovani: the +listing-summary page is also defined in lib/lp/soyuz/browser/configure.zcml, and in this case it's going to be for a SourcePackagePublishingHistory, so that will end up in sourcepackagepublishinghistory-listing-summary.pt [23:26] rpadovani: and then that goes off into @@publishinghistory-macros and you get to repeat the process again :)