Re: PostgreSQL not using index for statement with group by - Mailing list pgsql-performance

From Kevin Grittner
Subject Re: PostgreSQL not using index for statement with group by
Date
Msg-id 4A9FF6F1020000250002AA99@gw.wicourts.gov
Whole thread Raw
In response to PostgreSQL not using index for statement with group by  (Mark Starkman <mark.starkman@activant.com>)
List pgsql-performance
Mark Starkman <mark.starkman@activant.com> wrote:

> I'm not sure how to get it to return in
> reasonable amount of time.

Some more information could help.

What version of PostgreSQL is this?

Please give an overview of the hardware and OS.

Please show your postgresql.conf file, excluding comments.

Please run your query with EXPLAIN ANALYZE in front, so we can see the
execution plan, with cost estimates compared to actual information.
If the the plan indicates a sequential scan, and you think an indexed
scan may be faster, you might be able to coerce it into the indexed
plan for diagnostic purposes by running this on the connection before
an EXPLAIN ANALYZE run:

set enable_seqscan = off;

You don't want to leave it off, or try to use that in production, but
it might be useful in figuring out what's going on.

That might be enough to diagnose the issue.

-Kevin

pgsql-performance by date:

Previous
From: Ivan Voras
Date:
Subject: Re: Seeking performance advice and explanation for high I/O on 8.3
Next
From: "Scott Otis"
Date:
Subject: Re: Seeking performance advice and explanation for high I/O on 8.3