Re: Problem query

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "CS DBA" <cs_dba(at)consistentstate(dot)com>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Problem query
Date: 2011-06-02 13:47:02
Message-ID: 4DE74E06020000250003DFE6@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

CS DBA <cs_dba(at)consistentstate(dot)com> wrote:
> On 06/01/2011 03:38 PM, Kevin Grittner wrote:

>> select count(*) from
>> (select distinct max(pri_num)
>> from max_xtrv_st_t
>> group by tds_cx_ind, cxs_ind_2) x

> I've tried a number of alternates, each one wants to do a seq scan
> of the table (including your suggestion above).

Is there some reason to believe that a sequential scan isn't the
fastest way to get the data? When generating summary data like
this, it often is faster than lots of random access. If you can
coerce it into a faster plan by turning off enable_seqscan on the
connection before running the query, then we can look at how you
might adjust your costing parameters to get better plans.

-Kevin

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Kevin Grittner 2011-06-02 14:57:25 Re: Understanding Hash Join performance
Previous Message Jenish 2011-06-02 13:39:35 Re: Strange behavior of child table.