开发者

Qt SQLite SELECT queries are very slow on Symbian

开发者 https://www.devze.com 2023-03-07 11:34 出处:网络
I\'m writing an application with Qt for Symbian and I\'m using lots of little SQLite queries to fetch data from the database I\'ve created.

I'm writing an application with Qt for Symbian and I'm using lots of little SQLite queries to fetch data from the database I've created.

The problem is that some of the queries take over a second to execute. It seems that the execution time is random, because sometimes the simple SELECT queries run as fast as 1 or 2 milliseconds, and sometimes it takes over 1000 milliseconds.

I'm usually executing many such little queries in a row.

The queries are as开发者_开发问答 simple as:

SELECT field FROM table

Is there some sort of simultaneous access problem at work here or something similar?

Best regards


Is there some sort of simultaneous access problem at work here or something similar?

As far as i know sqlite uses whole base lock instead of table locks, so yes, that may be that trouble. If you write to base not so frequently, try to add indexes to columns you selecting from, and use where clauses to minimize count of rows returned. Creating, for example, 20-30k of QVariants may take a long time in debug mode...

0

精彩评论

暂无评论...
验证码 换一张
取 消