--- On Thu, 9/9/10, Simon Slavin <slav...@bigfraud.org> wrote:

From: Simon Slavin <slav...@bigfraud.org>
Subject: Re: [sqlite] In memory database and locking.
To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org>
Date: Thursday, September 9, 2010, 8:24 AM


On 9 Sep 2010, at 4:55am, Hemant Shah wrote:

> The other process wakes up every 60 seconds and deletes all row whose 
> timestamp columns is less then (current timestamp - 60). The timestamp is 
> number of seconds since epoch.

Do you do this using a single DELETE FROM command ?  Do you have an index on 
the timestamp column so it can find the appropriate rows quickly and easily ?


Yes, I run "DELETE FROM table WHERE instimestamp < deletetimestamp". I have 
index on this column.

> The first process is constantly inserting rows into the database, so the 
> other process cannot delete any rows.

I would probably merge the processes.  Have the one that does the inserting 
issue the DELETE FROM command.  So it could do a DELETE after every INSERT.  Or 
better still, after every 100 INSERTs or something.

I think this might work. I will give it a try.


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




Hemant Shah

E-mail: hj...@yahoo.com



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

Reply via email to