Re: BUG #2208: Low performance on select

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Fahri CAKIROGLU <fahri(at)gbks(dot)com(dot)tr>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2208: Low performance on select
Date: 2006-01-25 21:59:54
Message-ID: 20060125215954.GA86606@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Jan 25, 2006 at 12:32:31PM +0000, Fahri CAKIROGLU wrote:
> Consecutive selects from three different tables
> causes low performance(about 1500 ms).
> Same select count from two tables gives good performance(about 30 ms).

This might be due to caching. When you query two tables all of the
pages you need might be cached, but when you query a third table
some of the pages from the other tables might be evicted from the
cache. When you query one of those tables again the pages have to
be fetched from disk.

How big are the tables in question?

> All searched keys are indexed and individual execution
> of each query is very fast.

Could you post the EXPLAIN ANALYZE output of each query? Have you
tuned any of your postgresql.conf settings, in particular shared_buffers?
How much memory do you have?

--
Michael Fuhr

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tiago D. J. 2006-01-25 22:49:02 BUG #2211: select (1::float-1::float)*(-1) = -0 ??
Previous Message Ricardo Solanilla 2006-01-25 19:44:52 BUG #2210: an update query bug with a table but not with your backup