Comment 10 for bug 583553

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 583553] Re: Timeout accessing bug with lots of comments and attachments

1 121 2801 23 2778 SQL-launchpad-main-slave SELECT
LibraryFileContent.datecreated, LibraryFileContent.filesize,
LibraryFileContent.id, LibraryFileContent.md5, LibraryFileContent.sha1
FROM LibraryFileContent WHERE LibraryFileContent.id = %s LIMIT 1

Death-by-1000 queries : doing one query for these things will help a
lot. Figuring out why its being queried for may allow avoiding it
entirely.

My WAG: we're checking for deleted content:

=== modified file 'lib/canonical/launchpad/database/librarian.py'
--- lib/canonical/launchpad/database/librarian.py 2010-09-06
21:02:44 +0000
+++ lib/canonical/launchpad/database/librarian.py 2010-09-10
00:28:16 +0000
@@ -236,7 +236,7 @@

     @property
     def deleted(self):
- return self.content is None
+ return self.contentID is None

I'll put up a branch in a minute for this.