From: Tom Lane <tgl@sss.pgh.pa.us>
To: Timur Irmatov <thor@sarkor.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: index usage
Date: Fri, 17 Jan 2003 09:57:04 -0500
Message-ID: <11751.1042815424@sss.pgh.pa.us> (raw)
In-Reply-To: <10597430257.20030117164800@sarkor.com>
References: <10597430257.20030117164800@sarkor.com>
Timur Irmatov <thor@sarkor.com> writes:
> Limit (cost=0.00..0.19 rows=1 width=6) (actual time=0.43..0.43 rows=0 loops=1)
> -> Index Scan using timeindex on mediumstats (cost=0.00..2898.96 rows=15185 width=6) (actual time=0.42..0.42 rows=0 loops=1)
The planner has absolutely no clue about the behavior of your function,
and so its estimate of the number of rows matched is way off, leading to
a poor estimate of the cost of an indexscan. There is not much to be
done about this in the current system (though I've speculated about the
possibility of computing statistics for functional indexes).
Just out of curiosity, why don't you lose all this year/month/day stuff
and use a timestamp column? Less space, more functionality.
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, thor@sarkor.com
Subject: Re: index usage
In-Reply-To: <11751.1042815424@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