PDA

View Full Version : Problem regarding database in Qt



sudheer168
3rd January 2009, 06:36
Hi , I am using QT4.4.0 and SQLITE as my database .I working with a project in which handles huge data continuously.It mean i need to insert 150*50 per second.For this I used transactions ,its good.But at the same time I need to retrieve the data from table at same rate to show them in form of plots.I am avle to do that ,but if I am using select statement to retrieve the data it slow downs the insertion. The speed of insertion was reducing when both insertion and retrieve process going simultaneously from same table campared with only insertion.I want the speed of insertion should not reduce even if the select statement executed simultaneously.
So Please help me or suggest me to solve this problem.

With Regards,
Sudheer.

wysota
4th January 2009, 10:49
Transactions slow down manipulations on the database and at the same time prevent other "threads" from seeing records inserted into the database before the transaction is commited. What exactly do you need transactions for?

In addition if you store some data in the database and at the same time retrieve it back, maybe you can simply have some kind of cache in memory so that you can fill the cache before writing to the database and then read the data back immediately from cache instead of the database. It would be much faster this way.

sudheer168
6th January 2009, 09:37
Hi wysota,
Thanks for your kind reply. You got my problem clearly and suggested me to use cache memory. Can I solve this problem with out using cache and using database.If so please suggest me.
So please help me to solve this problem.

With Regards,
Sudheer.

wysota
6th January 2009, 10:16
Operating on files is much slower than operating on RAM, so your choice is clear - either you have a fast and versatile solution or slow and clumsy. If you want to stick using the DB only - go ahead and buy yourself a much faster machine. And get rid of transactions, by the way.

sudheer168
6th January 2009, 11:04
Hi wysota,
Thanks for your kind reply.

With Regards,
Sudheer.