Re: [PATCH] Equivalence Class Filters
От | David Rowley |
---|---|
Тема | Re: [PATCH] Equivalence Class Filters |
Дата | |
Msg-id | CAKJS1f9kKo0Dny-7PLRcAurAMLB5d1M5J_FgrEdCdinEXkd2cw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: [PATCH] Equivalence Class Filters (Simon Riggs <simon@2ndQuadrant.com>) |
Ответы |
Re: [PATCH] Equivalence Class Filters
|
Список | pgsql-hackers |
On 16 December 2015 at 13:26, Simon Riggs <simon@2ndquadrant.com> wrote:
There is an interesting real world case where we might get some use of these thoughts.If we have Orders and OrderItems (FK->Orders)and we also know (and can Assert) Order.order_date <= OrderItems.ship_datethen a restriction on Orders.order_date > X => OrderItem.ship_date > X when the two tables are joined on OrderIdand also a restriction on OrderItems.ship_date >= X => Orders.order_date < X when the two tables are joined on OrderIdSuch an assertion could be checked during the FK check, so would not be expensive to maintain.One for the future, at least, since we don't have any way of expressing or enforcing that just yet.
I'm just mentioning this as I wouldn't want someone to run off thinking this was a fantastic idea without being aware of the above, and waste time making the same mistakes as I did last year.
--
В списке pgsql-hackers по дате отправления: