Re: What is the quickest query in the database? - Mailing list pgsql-general

From Jan Wieck
Subject Re: What is the quickest query in the database?
Date
Msg-id 3E5533E9.7B6AAE83@Yahoo.com
Whole thread Raw
In response to What is the quickest query in the database?  (P G <pg_dba@yahoo.com>)
List pgsql-general
Tino Wildenhain wrote:
>
> Hi P G,
>
> On Thu, 20 Feb 2003 09:52:07 -0800 (PST)
> P G <pg_dba@yahoo.com> wrote:
>
> > What is the quickest and least intrusive query in the
> > database that will always succeed?
>
> select 1;

Not if you're currently in transaction aborted state.

An empty query is. In psql this can be done with just a semicolon. It
will not affect the current transaction state, it will return
PGRES_EMPTY_QUERY (IIRC) or bail out because of a lost connection. And
it doesn't even need to parse a single keyword.


Jan

>
> :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@postgresql.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


--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #

pgsql-general by date:

Previous
From: Jonathan Bartlett
Date:
Subject: Re: What is the quickest query in the database?
Next
From: "Robustelli Monica"
Date:
Subject: Postgres Error