Re: Select retrieval slowdown after db drop/reload. Suggestions? - Mailing list pgsql-general

From Scott Marlowe
Subject Re: Select retrieval slowdown after db drop/reload. Suggestions?
Date
Msg-id 1172701380.20651.159.camel@state.g2switchworks.com
Whole thread Raw
In response to Select retrieval slowdown after db drop/reload. Suggestions?  (Andrew Edson <cheighlund@yahoo.com>)
List pgsql-general
On Wed, 2007-02-28 at 13:55, Andrew Edson wrote:
> I have a select statement, used in a Perl program, which is supposed
> to find all records related to those in one table which have a
> delete_dt field value of four years or older.
>
> This is the select statement:
> SELECT t2.dist_id, t1.clnt_seq, t2.cntrct_seq, t2.cntrct_id,
> t3.aunit_seq, t1.person_seq, t1.addr_seq, t3.addr_seq, t4.frst_nm || '
> ' || t4.lst_nm AS name, t5.addr_1, t6.acntdel_dt FROM t1, t2, t3, t4,
> t5, t6 WHERE t1.clnt_seq = t2.clnt_seq AND t2.cntrct_seq =
> t3.cntrct_seq AND t3.aunit_seq = t6.aunit_seq AND t1.person_seq =
> t4.person_seq AND t3.addr_seq = t5.addr_seq AND t1.active_flg =0 AND
> t2.active_flg =0 AND t3.active_flg = 0 AND t6.acntdel_dt < now() - '4
> years'::interval order by t2.cntrct_id asc;

What version of pgsql are you running?

Is acntdel_dt indexed?

What does explain (and maybe explain analyze) for this query say?

What does it say on your other boxes?

pgsql-general by date:

Previous
From: "Brandon Aiken"
Date:
Subject: Re: Difference between UNIQUE constraint vs index
Next
From: Bill Moran
Date:
Subject: Re: How often do I need to reindex tables?