Re: Problem query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



CS DBA <cs_dba@xxxxxxxxxxxxxxxxxxx> 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

-- 
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux