Re: What is the fastest null WHERE

Поиск
Список
Период
Сортировка
От Shridhar Daithankar
Тема Re: What is the fastest null WHERE
Дата
Msg-id 3F7AC94E.1000407@persistent.co.in
обсуждение исходный текст
Ответ на What is the fastest null WHERE  ("Mindaugas Riauba" <mind@bi.lt>)
Список pgsql-performance
Mindaugas Riauba wrote:

>   Hello,
>
>   While writing web application I found that it would
> be very nice for me to have "null" WHERE clause. Like
> WHERE 1=1. Then it is easy to concat additional
> conditions just using $query . " AND col=false" syntax.
>
>   But which of the possible "null" clauses is the fastest
> one?

Rather than this approach, keep a flag which tells you whether or not it is
first where condition. If it is not first where condition, add a 'and'. That
would be simple, isn't it?

  Shridhar


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

Предыдущее
От: Jeff
Дата:
Сообщение: Re: Tuning/performance issue...
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: What is the fastest null WHERE