Re: query slow only after reboot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Title: Re: query slow only after reboot
You can try using the pg_stat_io table and related stat tables to figure out which ones are responsible for all this I/O on startup.
Then, for the big offenders issue a select count(*) on those right at the start, to force the OS to read the pages into memory.  This won’t be effective if these are too much larger than RAM.  Also, running queries that do large index scans on tables/indexes heavily used can help.
Its a brute force preload, but my guess is your woes are caused by random I/O on tables and indexes that you can attempt to pre-cache by forcing sequential access on some of that data.  There are many other ways to read heavily accessed tables or indexes into OS memory on a freshly restarted system — even just reading the raw files with something like grep.




On 2/9/09 5:21 PM, "Wei Yan" <weiyan1@xxxxxxxxx> wrote:

Hi:

Our queries are extremely slow only after db server reboot, not after restart postgres db only. The difference is about 10 mins vs. 8 secs. Not acceptable. I have browsed around , set the postgres db parameters as suggested. Still the same.

Any suggestion on how to tackle the problem?

Thanks
wei



[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux