On Mar 11, 2010, at 11:13 PM, Skand wrote:

>
> Hi Folks,
>
> Whats going on here? I would expect the following delete to delete
> everything under 9999999999.
>
> 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
>
> sqlite> select * from ip_domain_table where ttl < 9999999999 limit 1;
> 107.35.138.41|127.2.0.2|1266895619
>
> The first "select" shows that there are 1605343 entries which have  
> ttl below
> 9999999999. So after the following delete, shouldn't the number of  
> entries
> go down to 0? If the TTL corresponding to these entries were  
> something else,
> why should they be counted for in the select in the first place? The  
> delta
> of entries between the two selects should be 0.
>
> Do I have some fundamental misunderstanding about how sqlite stores  
> values
> in database?

Seems strange to me too.

What version of SQLite? Does running "PRAGMA integrity_check" reveal
any problems with the database file?

Dan.

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

Reply via email to