Re: A speed comparison with sqlite

From: Shane Ambler <pgsql(at)Sheeky(dot)Biz>
To: PostgreSQL Advocacy <pgsql-advocacy(at)postgresql(dot)org>
Subject: Re: A speed comparison with sqlite
Date: 2008-01-24 19:56:26
Message-ID: 4798ED6A.8020506@Sheeky.Biz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-advocacy

Shane Ambler wrote:
> Just thought I would share some rough numbers here.
> A bit of an unusual edge case but a big time difference...
>
>

Just following up with this comparison.

I have been in contact with the SQLite creator about this issue and have
found that SQLite's design leans it's default settings toward low memory
usage keeping with it's design goals of having a small footprint.

Even with that design goal, it doesn't lock you into that. You can tell
SQLite to use any memory it needs as well as how much of your db is
cached in RAM. You can also build SQLite to use these options as default.

One drawback with large datasets is that temp_store can get then get
larger than available ram invoking swapping and still negating the
benefits. (though I found this to still be quicker than the original tests)

Having said that - setting SQLite's temp_store to memory allows SQLite
to return SELECT DISTINCT(pincode) FROM codes; in around 15 minutes
compared to PostgreSQL's 9.7 minutes.

It seems that SQLite's sorting algorithm's are better suited for in
memory use than on disk use. This issue really only appears in large
datasets as used in my original timing examples. More specifically when
temp storage exceeds the OS disk cache size.
They are aware of this situation and are working on improvements.

--

Shane Ambler
pgSQL (at) Sheeky (dot) Biz

Get Sheeky @ http://Sheeky.Biz

In response to

Responses

Browse pgsql-advocacy by date

  From Date Subject
Next Message Joshua D. Drake 2008-01-24 20:38:13 Re: MySQL analysis
Previous Message Jan Wieck 2008-01-24 18:44:15 Re: MySQL analysis