Re: [GENERAL] Poor select count(*) performance

2009-02-24 Thread Sam Mason
On Mon, Feb 23, 2009 at 11:21:16PM -0800, Mike Ivanov wrote: > On Mon, Feb 23, 2009 at 6:54 PM, Sam Mason wrote: > > Depending on where these are on disk and how fast your disks are this > > could take up to 30 seconds. > > This does not sound very inspiring :-) It was calculated with a pessimis

Re: [GENERAL] Poor select count(*) performance

2009-02-23 Thread Mike Ivanov
On Mon, Feb 23, 2009 at 6:54 PM, Sam Mason wrote: Depending on where these are on disk and how fast your disks are this > could take up to 30 seconds. This does not sound very inspiring :-) Would throwing more hardware (memory, faster CPU) at the server improve the situation? > If you want t

Re: [GENERAL] Poor select count(*) performance

2009-02-23 Thread Sam Mason
On Mon, Feb 23, 2009 at 05:44:05PM -0800, Mike Ivanov wrote: > An hour ago it took 8 seconds, one minute ago the same query took just only > 7 milliseconds. > > Any ideas why the execution time varies so wildly? > > Explain Analyze gives: > > Aggregate (cost=2000.08..2000.09 rows=1 width=0) (ac

Re: [GENERAL] Poor select count(*) performance

2009-02-23 Thread Scott Marlowe
On Mon, Feb 23, 2009 at 6:44 PM, Mike Ivanov 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 mi

[GENERAL] Poor select count(*) performance

2009-02-23 Thread Mike Ivanov
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. Any ideas why the execution time varies so wildly? Expl