What's going on here? I would expect the next delete to remove everything from the table. Is there a fundamental misunderstanding of how sqlite3 works for me?
sqlite> .schema
CREATE TABLE ip_domain_table (ip_domain TEXT, answer TEXT, ttl INTEGER, PRIMARY KEY(ip_domain, answer, ttl));
sqlite> select count(*) from ip_domain_table where ttl < 9999999999 ;
1605343
sqlite> pragma cache_size=100000; delete from ip_domain_table where ttl < 9999999999;
sqlite> select count(*) from ip_domain_table where ttl < 9999999999 ;
258
Q : Why does the count show "258"? Shouldn't it be 0?
If I do this, it will delete all entries as expected.
sqlite> select count(*) from ip_domain_table;
1605343
sqlite> pragma cache_size=100000; delete from ip_domain_table;
sqlite> select count(*) from ip_domain_table;
0
source
share