On Monday, 25 February, 2019 05:43, Jonathan Moules <jonathan-li...@lightpear.com> wrote:
>CREATE TABLE error_codes ( > error_code INTEGER PRIMARY KEY > UNIQUE, > error TEXT >); You do not need (and should not) specify BOTH "PRIMARY KEY" and "UNIQUE". Both are enforced with a unique index and using both may result in extraneous duplicate indexes. Get rid of UNIQUE. >CREATE TABLE lookups ( > lookup_id INTEGER PRIMARY KEY AUTOINCREMENT, > content_hash TEXT COLLATE NOCASE, > error_code INTEGER REFERENCES error_codes (error_code), > exp_content_type TEXT COLLATE NOCASE >); >CREATE INDEX idx__content_hash ON lookups ( > content_hash >); You also need an index on "error_code" unless you want to "wait awhile" while some enforcement operations perform a table scan to find children rather than a simple index lookup ... >So I try and do an update on my data: > UPDATE lookups set error_code=3 and >exp_content_type='ogc_except' >WHERE content_hash = '0027f2c9b80002a6'; Clemens already explained that this is probably not what you wanted to do. --- The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users