Selecting a constant question

From: "Dann Corbit" <DCorbit(at)connx(dot)com>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: Selecting a constant question
Date: 2007-06-11 19:24:51
Message-ID: D425483C2C5C9F49B5B7A41F8944154701000702@postal.corporate.connx.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

SELECT 1 FROM test.dbo.a_003

gets about 60,000 records per second

SELECT '1' FROM test.dbo.a_003

gets about 600 records per second.

The cause is that postgres describes the return column as "unknown"
length 65534 in the 2nd case.

Since the value is a constant, it seems rather odd to make the length
65534 characters. Why not make it char(1) or some other appropriate and
less costly data type? After all, it isn't going to grow during the
query.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-06-11 19:42:18 Re: Selecting a constant question
Previous Message Florian G. Pflug 2007-06-11 18:35:48 Re: Is this a feature?