Very slow inner join query unacceptable latency - Mailing list pgsql-bugs

From
Subject Very slow inner join query unacceptable latency
Date
Msg-id 20130521135408.5a830134ae84016b0174832fdc1a3173.2de7d4ace3.wbe@email11.secureserver.net
Whole thread Raw
Responses Re: Very slow inner join query unacceptable latency  (Jaime Casanova <jaime@2ndquadrant.com>)
List pgsql-bugs
<span style=3D"font-family:Verdana; color:#000000; font-size:10=
pt;">The SARS_ACTS table currently has 37,115,515 rowswe have =
indexed: idx_sars_acts_acts_run_id ON SARS_ACTS USING btree (sars_run_id)<b=
r>we have pk constraint on the SARS_ACTS_RUN table; sars_acts_run_pkey PRIM=
ARY KEY (id )serverdb=3D# explain select count(*) as y0_ from SARS_=
ACTS this_ inner join SARS_ACTS_RUN tr1_ on this_.SARS_RUN_ID=3D<a href=3D"=
http://tr1_.ID">tr1_.ID where tr1_.ALGORITHM=3D'SMAT';  &=
nbsp;           &nbs=
p;            &=
nbsp;           &nbs=
p;            QUERY =
PLAN-------------------------------------------------------------------=
-------------------------------------------------------Aggregate  =
(cost=3D4213952.17..4213952.18 rows=3D1 width=3D0)  -> Hash Joi=
n  (cost=3D230573.06..4213943.93 rows=3D3296 width=3D0)  =
;     Hash Cond:  (this_.SARS_RUN_ID=3D<a href=3D"=
http://tr1_.ID">tr1_.ID)       -> =
 Seq Scan om sars_acts this_  (cost=3D0.00..3844241.84 rows=3D37092284=
 width=3D8)       ->  Hash  (cost=
=3D230565.81..230565.81 rows=3D580 width=3D8)     &=
nbsp;        -> Seq Scan on sars_acts=
_run tr1_  (cost=3D0.00..230565.81 rows=3D580 width=3D8) &nbs=
p;              &nbs=
p;  Filter:  ((algorithm)::text =3D 'SMAT'::text)(7 rows)=
This query executes in approximately 5.3 minutes to complete, very very=
 slow, our users are not happy. Does anyone have =
suggestions about how to speed it up?thanks </d=
iv>

pgsql-bugs by date:

Previous
From: Andrzej Cedro
Date:
Subject: Re: BUG #7659: LDAP auth does not search the subtree
Next
From: Jaime Casanova
Date:
Subject: Re: Very slow inner join query unacceptable latency