Comment 1 for bug 928048

Revision history for this message
Sergey Petrunia (sergefp) wrote :

== Analysis ==

Equality propagation converts the WHERE clause into this:

  (multiple equal(7, t1.a, t2.a) or (t2.b <= 1))
  and
  multiple equal(t1.a, t2.a)

This is ok.

Then, equality substitution produces this WHERE clause:

  (t1.a = 7) or (t2.b <= 1)

we dont expect this kind of WHERE clauses to be produced when
SJ-Materialization-Lookup strategy is used.

With that strategy, we expect that the WHERE clause can be broken into two
AND-parts:
- Part#1. depend only on SJ-inner tables
- Part#2. depend only on SJ-outer tables

The only thing joining the two parts is the IN-equality. IN-equality is not
put into the WHERE condition, it is generated and checked inside the
SJ-Materialization code.

However, make_join_select() gets this clause:

  (t1.a = 7) or (t2.b <= 1) (*)

which can only be checked when one has both t1.a and t2.b. This never happens,
so make_join_select() is unable to attach this condition anywhere, and it is
never checked.