Re: What is the quickest query in the database?
От | Jan Wieck |
---|---|
Тема | Re: What is the quickest query in the database? |
Дата | |
Msg-id | 3E5533E9.7B6AAE83@Yahoo.com обсуждение исходный текст |
Ответ на | What is the quickest query in the database? (P G <pg_dba@yahoo.com>) |
Список | 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 по дате отправления: