Search Postgresql Archives

Re: Poor select count(*) performance

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

 



On Mon, Feb 23, 2009 at 6:44 PM, Mike Ivanov <mike@xxxxxxxxxxxxxxx> wrote:
> Hi there,
>
> I'm sorry for a stupid question but I'm really stuck.
>
> A query:
>
> SELECT COUNT(*) FROM "lingq_card" WHERE "lingq_card"."context_id" = ...;
>
> An hour ago it took 8 seconds, one minute ago the same query took just only
> 7 milliseconds.

The two common causes are caching and changing query plans.

How many rows did it have to hit, did it use an index, which index did
it use, and were the rows it needed already in the pg shared_buffers
OR the OS / kernel file system cache when retrieved?

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux