Re: [SQL] sql performance and cache

From: Wei Weng <wweng(at)kencast(dot)com>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Chris Faulkner <chrisf(at)oramap(dot)com>, Pgsql-Performance <pgsql-performance(at)postgresql(dot)org>, Pgsql-Sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: [SQL] sql performance and cache
Date: 2003-10-14 16:48:06
Message-ID: Pine.LNX.4.56.0310141247370.7836@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance pgsql-sql

On Sat, 11 Oct 2003, Christopher Kings-Lynne wrote:

>
> > I have two very similar queries which I need to execute. They both have
> > exactly the same from / where conditions. When I execute the first, it takes
> > about 16 seconds. The second is executed almost immediately after, it takes
> > 13 seconds. In short, I'd like to know why the query result isn't being
> > cached and any ideas on how to improve the execution.
>
> <snip>
>
> > OK - so I could execute the query once, and get the maximum size of the
> > array and the result set in one. I know what I am doing is less than optimal
> > but I had expected the query results to be cached. So the second execution
> > would be very quick. So why aren't they ? I have increased my cache size -
> > shared_buffers is 2000 and I have doubled the default max_fsm... settings
> > (although I am not sure what they do). sort_mem is 8192.
>
> PostgreSQL does not have, and has never had a query cache - so nothing
> you do is going to make that second query faster.
>
> Perhaps you are confusing it with the MySQL query cache?
>
> Chris
>
Is there plan on developing one (query cache)?

Thanks

Wei

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2003-10-14 16:52:57 Re: [HACKERS] Sun performance - Major discovery!
Previous Message Tom Lane 2003-10-14 16:14:19 Re: [SQL] sql performance and cache

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2003-10-14 17:25:28 Re: about postgre SQL download
Previous Message Tom Lane 2003-10-14 16:14:19 Re: [SQL] sql performance and cache