Re: Problem query

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: CS DBA <cs_dba(at)consistentstate(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Problem query
Date: 2011-06-01 21:15:24
Message-ID: BANLkTimirG-4HDFXKbcgkagLes8eCjWwLQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Wed, Jun 1, 2011 at 3:14 PM, CS DBA <cs_dba(at)consistentstate(dot)com> wrote:
> Hi All;
>
> We have a table with approx 200 columns. about a dozen columns are text data
> types and the rest are a mix of integers , bigint's and double precision
> types.
>
> The table has about 25million rows.
>
>
> The app wants to run a query like this:
>
> select count(pri_num) from max_xtrv_st_t
> where pri_num in (select max(pri_num) from max_xtrv_st_t where 1=1
>                               group by tds_cx_ind, cxs_ind_2 )
>
> I've tried to split the query up but made little progress, pri_num and
>  tds_cx_ind are bigint's and  cxs_ind_2 is an integer
>
> The table has an index on all 3 columns (3 separate indexes)
>
> Anyone have any thoughts on tuning this query?

need postgres version# and the current explain analyze (or explain, if
you can't wait for it)

merlin

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Kevin Grittner 2011-06-01 21:38:16 Re: Problem query
Previous Message Tom Lane 2011-06-01 21:02:51 Re: [PERFORM] Hash Anti Join performance degradation