Re: Optimizing select count query which often takes over 10 seconds

From: Alexander Farber <alexander(dot)farber(at)gmail(dot)com>
To:
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Optimizing select count query which often takes over 10 seconds
Date: 2013-01-25 15:13:38
Message-ID: CAADeyWjvQCyftMvmHyzMMMRCaRKPGWWY7bRYUDQ3qmGhs7s70A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi -

On Thu, Jan 24, 2013 at 8:12 PM, Guillaume Lelarge
<guillaume(at)lelarge(dot)info> wrote:
> You should better create an index on pref_money(yw, money). It could
> help you get rid of the seqscan and sort operations.

I've created an index with

# create index pref_money_money_index on pref_money(money desc);

and posted the new EXPLAIN output here:

http://stackoverflow.com/questions/14498974/optimizing-select-count-query-which-often-takes-over-10-seconds

But it doesn't seem to change much or
am I too unexperienced to see the change?

Thanks
Alex

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2013-01-25 15:26:10 Re: BUG #6510: A simple prompt is displayed using wrong charset
Previous Message Rodrigo Pereira da Silva 2013-01-25 15:08:03 Re: Throttling Streamming Replication