Search Postgresql Archives

Re: a LEFT JOIN problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux