Revision 3276
Added by Aaron Marcuse-Kubitza over 12 years ago
vegbien.sql | ||
---|---|---|
4969 | 4969 |
-- Name: plantname_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: |
4970 | 4970 |
-- |
4971 | 4971 |
|
4972 |
CREATE UNIQUE INDEX plantname_unique ON plantname USING btree ((COALESCE(parent_id, 2147483647)), (COALESCE(scope_id, 2147483647)), rank, plantname);
|
|
4972 |
CREATE UNIQUE INDEX plantname_unique ON plantname USING btree ((COALESCE(parent_id, 2147483647)), rank, plantname, (COALESCE(scope_id, 2147483647)));
|
|
4973 | 4973 |
|
4974 | 4974 |
|
4975 | 4975 |
-- |
Also available in: Unified diff
schemas/vegbien.sql: plantname: plantname_unique UNIQUE INDEX: Moved scope_id to the back so that the index can easily be used for lookup queries (not just column-based import) without having to explicitly specify NULL for that field. This takes advantage of a btree sorting feature where a broader lookup can be done using just the first n columns of the index.