From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jim C. Nasby <decibel@decibel.org>
Cc: pgsql-performance@postgresql.org
Subject: Re: seqscan strikes again
Date: Tue, 09 Nov 2004 18:24:32 -0500
Message-ID: <6304.1100042672@sss.pgh.pa.us> (raw)
In-Reply-To: <20041109222345.GG46084@decibel.org>
References: <20041109222345.GG46084@decibel.org>
"Jim C. Nasby" <decibel@decibel.org> writes:
> I'm wondering if there's any way I can tweak things so that the estimate
> for the query is more accurate (I have run analyze):
> -> Index Scan using alert__tick_tsz on alert (cost=0.00..2498.49 rows=7119 width=28) (actual time=0.006..0.030 rows=12 loops=1413)
> Index Cond: (("outer".prev_end_time < ms_t(alert.tick)) AND ("outer".end_time >= ms_t(alert.tick)))
Can you alter the data representation? 7.4 doesn't have any stats about
functional indexes and so it's not likely to come up with a good number
about the selectivity of the index on ms_t(tick). It might be worth
materializing that value as a plain column and indexing the column.
(This being a join, I'm not sure it would help any, but it seems worth
trying.)
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, decibel@decibel.org
Subject: Re: seqscan strikes again
In-Reply-To: <6304.1100042672@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