From: greg@turnstep.com
To: pgsql-sql@postgresql.org
Cc: david_shadovitz@xontech.com
Subject: Re: Fetch a single record
Date: Wed, 10 Dec 2003 00:45:40 -0000
Message-ID: <e5b118baca8d81434e5616bfe8c0ddf1@biglumber.com> (raw)
In-Reply-To: <8b37e2e5.0312051351.4045b4e@posting.google.com>
-----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-----
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: greg@turnstep.com, david_shadovitz@xontech.com
Subject: Re: Fetch a single record
In-Reply-To: <e5b118baca8d81434e5616bfe8c0ddf1@biglumber.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox