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

From: Scott Ribe <scott_ribe(at)killerbytes(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: (Select *) vs. (Select id) from table.
Date: 2006-01-08 23:52:05
Message-ID: BFE6F3B5.3D2B4%scott_ribe@killerbytes.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> 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. But in the original example:

select id, updated_date from customers limit 100

Sybase, for instance, would not use table pages at all if there were an
index covering id & updated_date.

--
Scott Ribe
scott_ribe(at)killerbytes(dot)com
http://www.killerbytes.com/
(303) 665-7007 voice

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Doug McNaught 2006-01-09 00:14:32 Re: (Select *) vs. (Select id) from table.
Previous Message pairat 2006-01-08 23:29:03 Re: The connection is dead