Skip site navigation (1) Skip section navigation (2)

Re: More speed counting rows

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Developer <dev002(at)pas-world(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: More speed counting rows
Date: 2009-07-27 13:39:32
Message-ID: dcc563d10907270639n634086c0j904348ed3faa0744@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-performance
On Mon, Jul 27, 2009 at 3:06 AM, Developer<dev002(at)pas-world(dot)com> wrote:
> Hello,
>
> I am trying to optimize the count of files when I am using filters
> (select by some row/s parameter/s)
>
> In this case I think that postgresql really count all files.
> Resulting in unacceptable times of 4 seconds in http server response.
> Triggers+store in this case do not see very acceptable, because I need
> store 1.5 millions of counting possibilities.
>
> My question is:
> Any method for indirect count like ordered indexes + quadratic count?
> Any module?
> Any suggestion?

Postgres cannot just use indexes, it has tot hit the tables.  Rather
than suspecting what pgsql is doing, use explain analyze select ... to
see what your query is actually doing.  If it is having to scan the
table each time, then faster IO or a different table layout may be in
order.

In response to

pgsql-performance by date

Next:From: Thomas ZaksekDate: 2009-07-27 14:09:12
Subject: select query performance question
Previous:From: Віталій ТимчишинDate: 2009-07-27 12:59:17
Subject: Re: Can Postgres use an INDEX over an OR?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group