From: Richard van den Berg <richard.vandenberg@trust-factory.com>
To: John A Meinel <john@arbash-meinel.com>
Cc: pgsql-perform <pgsql-performance@postgresql.org>
Subject: Re: When are index scans used over seq scans?
Date: Wed, 20 Apr 2005 17:15:37 +0200
Message-ID: <42667219.7050907@trust-factory.com> (raw)
In-Reply-To: <42666890.1000401@arbash-meinel.com>
References: <426665A0.1080102@trust-factory.com>
<42666890.1000401@arbash-meinel.com>
John A Meinel wrote:
> I believe the problem is that postgres doesn't recognize how restrictive
> a date-range is unless it uses constants.
And it does when using BETWEEN with int for example? Impressive. :-)
> select blah from du WHERE time between '2004-10-10' and '2004-10-15';
> Will properly use the index, because it realizes it only returns a few
> rows.
Correct, it does.
> Probably you should try to find out the status of multi-table
> selectivity. It was discussed in the last couple of months.
I can't find the posts you are refering to. What is the priciple of
multi-table selectivity?
Your explanation sounds very plausible.. I don't mind changing the
cpu_tuple_cost before running BETWEEN with timestamps, they are easy
enough to spot.
Thanks,
--
Richard van den Berg, CISSP
-------------------------------------------
Trust Factory B.V. | www.dna-portal.net
Bazarstraat 44a | www.trust-factory.com
2518AK The Hague | Phone: +31 70 3620684
The Netherlands | Fax : +31 70 3603009
-------------------------------------------
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: richard.vandenberg@trust-factory.com, john@arbash-meinel.com
Subject: Re: When are index scans used over seq scans?
In-Reply-To: <42667219.7050907@trust-factory.com>
* 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