Re: What is the quickest query in the database?

From: Medi Montaseri <medi(dot)montaseri(at)intransa(dot)com>
To: Jonathan Bartlett <johnnyb(at)eskimo(dot)com>
Cc: Tino Wildenhain <tino(at)wildenhain(dot)de>, P G <pg_dba(at)yahoo(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: What is the quickest query in the database?
Date: 2003-02-20 23:29:25
Message-ID: 3E5564D5.8090503@intransa.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

It sounds like the caller is simply trying to see if the engine is up
and operational.
If that is the case, then just connect, disconnect.

Jonathan Bartlett wrote:

>Might select NULL; be faster, since the number doesn't have to be parsed,
>and null is probably a keyword?
>
>Jon
>
>On Thu, 20 Feb 2003, Tino Wildenhain wrote:
>
>
>
>>Hi P G,
>>
>>On Thu, 20 Feb 2003 09:52:07 -0800 (PST)
>>P G <pg_dba(at)yahoo(dot)com> wrote:
>>
>>
>>
>>>What is the quickest and least intrusive query in the
>>>database that will always succeed?
>>>
>>>
>>select 1;
>>
>>:o)
>>
>>Regards
>>Tino
>>
>>
>>
>>
>>>select current_user;
>>>
>>>-- OR --
>>>
>>>select datname from pg_database where datname =
>>>'some_database';
>>>
>>>Or would it be something else?
>>>
>>>TIA.
>>>
>>>__________________________________________________
>>>Do you Yahoo!?
>>>Yahoo! Tax Center - forms, calculators, tips, more
>>>http://taxes.yahoo.com/
>>>
>>>---------------------------(end of broadcast)---------------------------
>>>TIP 3: if posting/reading through Usenet, please send an appropriate
>>>subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
>>>message can get through to the mailing list cleanly
>>>
>>>
>>>
>>---------------------------(end of broadcast)---------------------------
>>TIP 5: Have you checked our extensive FAQ?
>>
>>http://www.postgresql.org/users-lounge/docs/faq.html
>>
>>
>>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 3: if posting/reading through Usenet, please send an appropriate
>subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
>message can get through to the mailing list cleanly
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message P G 2003-02-20 23:29:43 Re: What is the quickest query in the database?
Previous Message Tom Lane 2003-02-20 22:58:09 Re: Fwd: REWRITE_INVOKE_MAX and "query may contain cycles"