logoalt Hacker News

eurleiftoday at 9:46 AM4 repliesview on HN

Because it doesn't make a difference, because `SELECT 1` doesn't need to touch the database:

    Running 100,000 `SELECT 1` queries:
    PostgreSQL (localhost): 2.71 seconds
    SQLite (in-memory): 0.07 seconds
    SQLite (tempfile): 0.07 seconds
(https://gist.github.com/leifkb/d8778422d450d9a3f103ed43258cc...)

Replies

oldsecondhandtoday at 10:04 AM

Why are you doing meaningless microbenchmarks?

show 1 reply
j45today at 7:34 PM

Queries for small SaaS are usually in the thousands of records, if not hundreds.

locknitpickertoday at 10:24 AM

> Because it doesn't make a difference, because `SELECT 1` doesn't need to touch the database:

I hope you understand that your claim boils down to stating that SQLite is faster at doing nothing at all, which is a silly case to make.

show 1 reply
nchmytoday at 4:03 PM

How about pg on Unix socket?

show 1 reply