Merge lp:~stevenk/launchpad/db-searchablenames-for-pu into lp:launchpad/db-devel

Proposed by Steve Kowalik
Status: Merged
Merged at revision: 12184
Proposed branch: lp:~stevenk/launchpad/db-searchablenames-for-pu
Merge into: lp:launchpad/db-devel
Diff against target: 12 lines (+8/-0)
1 file modified
database/schema/patch-2209-40-0.sql (+8/-0)
To merge this branch: bzr merge lp:~stevenk/launchpad/db-searchablenames-for-pu
Reviewer Review Type Date Requested Status
Stuart Bishop (community) db Approve
Review via email: mp+136568@code.launchpad.net

Description of the change

Add a searchable_names column to PackageUpload. This is supplemented by a trigram index that allows us to do efficient substring matching. This column will be set by methods on PackageUpload, such as addSource() and addBuild() as well as a garbo job to populate old records.

To post a comment you must log in.
Revision history for this message
Stuart Bishop (stub) wrote :

Fine for the ALTER TABLE, but the index creation needs to be done in a separate patch (even if all 4 million+ rows are all NULL, the index build is still to slow for fast downtime).

Best time to build the index is after the column has been populated if you are going to backfill.

review: Approve (db)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'database/schema/patch-2209-40-0.sql'
2--- database/schema/patch-2209-40-0.sql 1970-01-01 00:00:00 +0000
3+++ database/schema/patch-2209-40-0.sql 2012-11-28 12:35:24 +0000
4@@ -0,0 +1,8 @@
5+-- Copyright 2012 Canonical Ltd. This software is licensed under the
6+-- GNU Affero General Public License version 3 (see the file LICENSE).
7+
8+SET client_min_messages=ERROR;
9+
10+ALTER TABLE packageupload ADD COLUMN searchable_names TEXT;
11+
12+INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 40, 0);

Subscribers

People subscribed via source and target branches

to status/vote changes: