How much control do you have? Can you put out your date code into an integer field? Can you set an index on id, projId, and Xtrab ?
regards, Adam ________________________________________ From: sqlite-users <sqlite-users-boun...@mailinglists.sqlite.org> on behalf of jose isaias cabrera <jic...@barrioinvi.net> Sent: February 13, 2017 10:32:00 AM To: sqlite-users@mailinglists.sqlite.org Subject: [sqlite] Faster check: > or != Greetings! I have a bunch of records to check, and I am wondering which is a faster check. I am attaching a network DB as client, ATTACH 'h:\bkup\test.db' AS client; and then do an INSERT based on some logic, and one of those login is checking against a variable or an actual DB value. Here are the different SQL syntaxes: BEGIN; INSERT OR REPLACE INTO OpenProjects SELECT * FROM client.OpenProjects WHERE id IN ( SELECT id FROM client.OpenProjects WHERE client.OpenProjects.id = id AND client.OpenProjects.ProjID <= 133560 AND client.OpenProjects.XtraB != XtraB -- change ); END; BEGIN; INSERT OR REPLACE INTO OpenProjects SELECT * FROM client.OpenProjects WHERE id IN ( SELECT id FROM client.OpenProjects WHERE client.OpenProjects.id = id AND client.OpenProjects.ProjID <= 133560 AND client.OpenProjects.XtraB > '2017-02-10 00:00:00' -- change ); END; Any input would be greatly appreciated. Thanks. josé _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users =============== CONFIDENTIALITY NOTICE: This e-mail and any attachments contain information from Lytx, Inc. and/or its affiliates, and are intended solely for the use of the named recipient(s). This e-mail may contain confidential information of Lytx and its customers. Any dissemination of this e-mail by anyone other than an intended recipient is strictly prohibited. If you are not a named recipient, you are prohibited from any further viewing of the e-mail or any attachments or from making any use of the e-mail or attachments. If you believe you have received this e-mail in error, notify the sender immediately and permanently delete the e-mail, any attachments, and all copies thereof from any drives or storage media and destroy any printouts of the e-mail or attachments. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users