Hello,

I have a table like this:

CREATE TABLE queue (
    key TEXT NOT NULL PRIMARY KEY UNIQUE,
    status INTEGER
);
CREATE INDEX IF NOT EXISTS keys ON queue (key);


And then I process it like this, N keys at a time:

SELECT key FROM queue WHERE status=0 LIMIT N;
BEGIN TRANSACTION;
for key in keys:
    UPDATE queue SET status=1 WHERE key=key;
END TRANSACTION;


How can this SELECT and UPDATE be combined more efficiently?

Richard
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to