Skip site navigation (1) Skip section navigation (2)

Performance of multiple queries?

From: Leif K-Brooks <eurleif(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Performance of multiple queries?
Date: 2005-04-21 09:33:12
Message-ID: 85d9a90905042102336d824c95@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
I'm wondering about the performance of using one query versus several.
For instance, how much slower would several queries be:

SELECT name FROM table WHERE id=123;
SELECT value FROM table WHERE id=123;
SELECT type FROM table WHERE id=123;

As compared to one larger equivalent query:

SELECT name, value, type FROM table WHERE id=123;

It would be immensely easier for my application to use multiple small
queries so that it wouldn't need to worry about invalidating a cache
after a period of time, but if the performance hit would be too large,
I suppose I'll bite the bullet and write the annoying caching code.

Responses

pgsql-novice by date

Next:From: Kalyanaraman RajaramanDate: 2005-04-21 10:19:36
Subject: Transaction processing performance
Previous:From: tövisDate: 2005-04-20 22:04:17
Subject: localisation - collation sequencies

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group