From: Tom Lane <tgl@sss.pgh.pa.us>
To: Patrick Hatcher <PHatcher@macys.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Slow query. Any way to speed up?
Date: Fri, 06 Jan 2006 15:24:09 -0500
Message-ID: <22453.1136579049@sss.pgh.pa.us> (raw)
In-Reply-To: <OFD2EE5DFB.2FA6D785-ON882570EE.00679B43-882570EE.0067F414@FDS.com>
References: <OFD2EE5DFB.2FA6D785-ON882570EE.00679B43-882570EE.0067F414@FDS.com>
Patrick Hatcher <PHatcher@macys.com> writes:
> -> Seq Scan on cdm_ddw_tran_item a1
> (cost=0.00..1547562.88 rows=8754773 width=23) (actual
> time=14.219..535704.691 rows=10838135 loops=1)
> Filter: ((((appl_id)::text = 'MCOM'::text)
> OR ((appl_id)::text = 'NET'::text)) AND ((tran_typ_id = 'S'::bpchar) OR
> (tran_typ_id = 'R'::bpchar)))
The bulk of the time is evidently going into this step. You didn't say
how big cdm_ddw_tran_item is, but unless it's in the billion-row range,
an indexscan isn't going to help for pulling out 10 million rows.
This may be about the best you can do :-(
If it *is* in the billion-row range, PG 8.1's bitmap indexscan facility
would probably help.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, PHatcher@macys.com
Subject: Re: Slow query. Any way to speed up?
In-Reply-To: <22453.1136579049@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox