Re: [HACKERS] Change in order of criteria - reg

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: [HACKERS] Change in order of criteria - reg
Дата
Msg-id CAKFQuwYcB6EwtAYpMWE=faEM1AeGTM39vwRGtTZhyR=9rjK3MQ@mail.gmail.com
обсуждение исходный текст
Ответ на Change in order of criteria - reg  (sri harsha <sriharsha9992@gmail.com>)
Список pgsql-general
On Wed, Jun 1, 2016 at 12:07 AM, sri harsha <sriharsha9992@gmail.com> wrote:

Hi,

    In PostgreSQL , does the order in which the criteria is given matter ?? For example

Query 1 : Select * from TABLE where a > 5 and b < 10;

Query 2 : Select * from TABLE where b <10 and a > 5;

Are query 1 and query 2 the same in PostgreSQL or different ?? If its different , WHY ??


​Why are you asking?  Do you have any context in which you want to measure "sameness"?

I
​ was thinking that pg_stat_statements might treat them differently but the comparison there is object based, not string based, so these should end up with the same hash.

​If everything is working correctly there will be no observable and persistent difference between executing those exact two queries as far as PostgreSQL is concerned. You might find a difference in the parse tree representation where a > 5 is on the left leaf of a branch in one query but on the right leaf in the other...

David J.

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] Change in order of criteria - reg
Следующее
От: Leonardo M. Ramé
Дата:
Сообщение: Londiste3 - Ubuntu 16.04 - Postgresql 9.3