From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Jona <jonanews(at)oismail(dot)com> |
Cc: | pgsql-performance(at)postgresql(dot)org |
Subject: | Re: How to enhance the chance that data is in disk cache |
Date: | 2005-06-13 14:51:39 |
Message-ID: | 19818.1118674299@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
Jona <jonanews(at)oismail(dot)com> writes:
> I have a query (please refer to
> http://213.173.234.215:8080/get_content_plan.htm for the query as well
> as query plan) that is slow when it's run the first time and fast(ish)
> on all successive runs within a reasonable time period.
> This leads me to suspect that when the query is first run, all used data
> have to be fetched from the disk where as once it has been run all data
> is available in the OS's disk cache.
Sounds like that to me too.
> Is there anway to either enhance the chance that the data can be found
> in the disk cache or allowing the database to fetch the data faster?
Run the query more often?
Also, that pile of INNER JOINs is forcing a probably-bad join order;
you need to think carefully about the order you want things joined in,
or else convert the query to non-JOIN syntax. See the "Performance
Tips" chapter of the manual.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | John A Meinel | 2005-06-13 14:51:57 | Re: Index ot being used |
Previous Message | John A Meinel | 2005-06-13 14:47:10 | Re: PostgreSQL using the wrong Index |