Skip site navigation (1) Skip section navigation (2)

Re: Index on function less well cached than "regular" index ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Paul Mackay" <mackaypaul(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Index on function less well cached than "regular" index ?
Date: 2006-04-24 22:11:44
Message-ID: 7022.1145916704@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
"Paul Mackay" <mackaypaul(at)gmail(dot)com> writes:
> ...
> EXPLAIN shows that an index scan is used by the planner. A query returning
> the maximum 200 number of records takes around 20 ms. What is surprising is
> that the same query executed several times takes practically the same time,
> as if the result was not cached.
> ...
> Could the problem be that an index on a function result is not cached or
> less well cached ?

I can't see how that would be.  The index machinery has no idea what
it's indexing, and the kernel disk cache even less.

Perhaps the majority of the runtime is going somewhere else, like the
initial evaluation of the function value to compare against?  Or maybe
you've found some inefficiency in the planner's handling of function
indexes.  Try comparing EXPLAIN ANALYZE output for the two cases to see
if the discrepancy exists during query runtime, or if it's upstream at
plan time.

			regards, tom lane

In response to

pgsql-performance by date

Next:From: Sriram DandapaniDate: 2006-04-24 22:45:14
Subject: ip address data type
Previous:From: Jim C. NasbyDate: 2006-04-24 21:00:18
Subject: Re: GROUP BY Vs. Sub SELECT

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group