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

Re: planner/optimizer question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: brad-pgperf(at)duttonbros(dot)com
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: planner/optimizer question
Date: 2004-04-28 04:27:59
Message-ID: 23032.1083126479@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
brad-pgperf(at)duttonbros(dot)com writes:
> ... Wouldn't the most efficient plan be to scan the index regardless
> of crm_id because the only columns needed are in the index?

No.  People coming from other databases often have the misconception
that queries can be answered by looking only at an index.  That is never
true in Postgres because row validity info is only stored in the table;
so we must always visit the table entry to make sure the row is still
valid/visible for the current query.

Accordingly, columns added to the index that aren't constrained by the
WHERE clause are not very useful ...

			regards, tom lane

In response to

Responses

pgsql-performance by date

Next:From: Gary DoadesDate: 2004-04-28 06:35:41
Subject: Re: planner/optimizer question
Previous:From: Christopher Kings-LynneDate: 2004-04-28 01:30:44
Subject: Re: [JDBC] [PERFORM] is a good practice to create an index on the

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