Rewriting select statements

Поиск
Список
Период
Сортировка
От Phil Cairns
Тема Rewriting select statements
Дата
Msg-id 01e301ca599c$95148280$bf3d8780$@com.au
обсуждение исходный текст
Ответы Re: Rewriting select statements  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Rewriting select statements  (Scott Marlowe <scott.marlowe@gmail.com>)
Список pgsql-general
I want to have the server do this:

If the query has no where clause, use a where clause of "where 1=0".

Is this possible?

Why would I want to do this? Because a third party library (ArcGIS) has a
"feature" such that when a relation name is registered with it, it does a
"select * from <relation>" and then does nothing with the results. It looks
like it's just checking the field names or the fact that the relation
exists. In this case, it's selecting a view that joins 14 tables. The main
table has 350,000 rows, and some of the subsidiary tables have up to 1.5
million rows. This view is not queried without a where clause during the
normal execution of the program, so to save between 6 and 20 minutes of
startup time depending on server load, I'd like to be able to add the where
clause.

Thanks for any help,
Phil Cairns.


В списке pgsql-general по дате отправления:

Предыдущее
От: Scott Bailey
Дата:
Сообщение: Re: Absolute value of intervals
Следующее
От: Tom Lane
Дата:
Сообщение: Re: CREATE TABLE LIKE and SERIAL