Ligesh,

Ligesh wrote:

I am running a very simple sql query with only one instance. The query is 
something like:

select * from table where parent_name = 'parent' order by name limit 10

My guess (and it is only a guess) is that, because of the ORDER BY clause, SQLite is loading all rows into memory, then sorting them in-memory.

Here's a tip which might actually help you: If your rows are around 1kb in size, it might be worth increasing the page size to, say, 4096, so as not to cause spillovers onto other pages.

You don't say what platform you are running on. At least for me, having a page size of 4096 increases performance on Win32, probably because it matches the size of the Win32 memory cache page size. You will find the relevant #define in pager.h. There, it says that increasing the page size will not really give you a performance edge. This is true on Linux, not on Windows, I've found. However, increasing the page size beyond 4096 does nothing for me in terms of increased performance.

Cheers,

Ulrik P.

--
Ulrik Petersen, Denmark


Reply via email to