Re: a LEFT JOIN problem

Поиск
Список
Период
Сортировка
От Thomas
Тема Re: a LEFT JOIN problem
Дата
Msg-id 55da14450810301611h3f20d1d1yfb0890c21b6258ee@mail.gmail.com
обсуждение исходный текст
Ответ на Re: a LEFT JOIN problem  (Thomas <iamkenzo@gmail.com>)
Список pgsql-general
I have found a trick to fool the system: I use an ORDER BY
response_code 0 ASC LIMIT 1

As unpaid orders receive a response_code > 0, then necessarily the
first record has response_code of 0.

However if more and more orders come into the equation, this means
PgSQL will have to process more records, how is it optimized? I guess
PgSQL will have to find all the records, than order them by
response_code ASC, and then pick the first one.

This is probably not a good practice? Should I go for 2 distinct queries?

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

Предыдущее
От: Thomas
Дата:
Сообщение: Re: a LEFT JOIN problem
Следующее
От: "Matthew T. O'Connor"
Дата:
Сообщение: Re: autovacuum