Re: Fetch a single record - Mailing list pgsql-sql

From greg@turnstep.com
Subject Re: Fetch a single record
Date
Msg-id e5b118baca8d81434e5616bfe8c0ddf1@biglumber.com
Whole thread Raw
In response to Fetch a single record  (david_shadovitz@xontech.com (David Shadovitz))
List pgsql-sql
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
> I'm looking for the fastest way to fetch a single record from a table.
> I don't care what record it is.
That's a strange request. If you really don't care what comes back, you
don't even need to query a table:
SELECT 1;
If you perhaps want the column names, query the system tables.
Otherwise the LIMIT 1 should be very fast, especially if you have no
ordering. Avoid the "SELECT *" if you don't need all the columns
for a little more speed.
- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200312091943
-----BEGIN PGP SIGNATURE-----
iD8DBQE/1mynvJuQZxSWSsgRAk0HAKDKTHglcodYw2G9j5Il60e96Vv/xwCfcZ6p
ffIBwsqFtqW0UABYttqzT3U=
=JV2a
-----END PGP SIGNATURE-----




pgsql-sql by date:

Previous
From: Paul Thomas
Date:
Subject: Re: Fetch a single record
Next
From: Paul Thomas
Date:
Subject: Re: How to specify the beginning of the month in Postgres SQL syntax?