> Ryan Johnson <ryan.johnson@...> writes:
> histo = list(conn.execute('select min(rowid) lo, max(rowid) hi, count(*)
> n from lineitem group by rowid/10000' order by lo))
...
> a,b,n = buckets[-1]
Thank you for your reply.
You code is not very correct ("a" always remain 0),
but I got your idea (and tested it).
Bucket creation adds about 50% to the time of update, which is acceptable.
By the way, I also posted my question at
http://stackoverflow.com/questions/17099491/sqlite3-how-to-interrupt-a-long-running-update-without-roll-back
So, if you care, you may wish to post your "bucket" solution there as well,
in case somebody will need it.
> Why not use a trigger on T to update C1 whenever it gets set to NULL?
My case is actually simpler: C1 is NULL only on newly inserted rows
(I should have said this from the beginning).
So, I just realized that if I enable AUTOINCREMENT feature,
then I do not need to process entire rowid range,
but only range of rows added after the last update.
This range should not have many holes and I can process this range
10,000 rowids at a time.
This will work until rowid will reach the largest possible integer.
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users