| От | Mindaugas Riauba |
|---|---|
| Тема | Re: What is the fastest null WHERE |
| Дата | |
| Msg-id | 085401c3881c$bacfaca0$f20214ac@bite.lt обсуждение исходный текст |
| Ответ на | What is the fastest null WHERE ("Mindaugas Riauba" <mind@bi.lt>) |
| Список | pgsql-performance |
> > 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?
>
> I suspect WHERE true, but is it really necessary.
Thanks. I'll use "WHERE true" for now. And of course it is
not necessary it just simplifies code a bit.
> Most languages will have a join() operator that lets you do something
like:
>
> $where_cond = join(' AND ', @list_of_tests)
That's not the case. Test may or may not be performed based on
web form values.
Mindaugas
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера