Re: (Select *) vs. (Select id) from table.

From: Doug McNaught <doug(at)mcnaught(dot)org>
To: Scott Ribe <scott_ribe(at)killerbytes(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: (Select *) vs. (Select id) from table.
Date: 2006-01-09 00:14:32
Message-ID: 87wtha6yvr.fsf@asmodeus.mcnaught.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Scott Ribe <scott_ribe(at)killerbytes(dot)com> writes:

>> The time the DB needs to find the record
>> should be the same since the record has to be found before the resultset is
>> assembled.
>
> What if the query can be satisfied from an index? I don't know if PostgreSQL
> has this kind of optimization or not.

Nope. Tuple visibility isn't stored in indexes, so it still has to
visit the heap to see if a row is visible to your transaction.

-Doug

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Postgres User 2006-01-09 00:54:45 Re: Installing Postgres 8.1 on Windows Server 2003 R2
Previous Message Scott Ribe 2006-01-08 23:52:05 Re: (Select *) vs. (Select id) from table.