Query Cost

From: ShepherdHill DB Subscriptions <db(dot)subscriptions(at)shepherdhill(dot)biz>
To: pgsql-general(at)postgresql(dot)org
Subject: Query Cost
Date: 2005-09-18 18:40:26
Message-ID: 432DB49A.40904@shepherdhill.biz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I have a table with this schema:

CREATE TABLE billing.bill
(
sno serial NOT NULL,
billno int4,
det date NOT NULL,
.
.
.
CONSTRAINT bill_pkey PRIMARY KEY (sno)
)

I want to execute a query that will not return any record. Which of
these queries is cheaper please?

1. Select * from billing.bill where 1=0
2. Select * from billing.bill where sno=0

Thanks for your assistance.

Chris.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Ribe 2005-09-18 21:03:38 Re: Asychronous database replication
Previous Message Jim C. Nasby 2005-09-18 14:12:28 Re: ltree and ordering - what index?