mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-08-25 02:47:18 +02:00
so remove them from MergeJoin node. Hack together a partial solution for commuted mergejoin operators --- yesterday a mergejoin int4 = int8 would crash if the planner decided to commute it, today it works. The planner's representation of mergejoins really needs a rewrite though. Also, further testing of mergejoin ops in opr_sanity regress test.
140 lines
6.4 KiB
Plaintext
140 lines
6.4 KiB
Plaintext
QUERY: SELECT p1.oid, p1.* FROM pg_operator AS p1
|
|
WHERE p1.oprleft != 0 AND NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = p1.oprleft);
|
|
oid|oprname|oprowner|oprprec|oprkind|oprisleft|oprcanhash|oprleft|oprright|oprresult|oprcom|oprnegate|oprlsortop|oprrsortop|oprcode|oprrest|oprjoin
|
|
---+-------+--------+-------+-------+---------+----------+-------+--------+---------+------+---------+----------+----------+-------+-------+-------
|
|
(0 rows)
|
|
|
|
QUERY: SELECT p1.oid, p1.* FROM pg_operator AS p1
|
|
WHERE p1.oprright != 0 AND NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = p1.oprright);
|
|
oid|oprname|oprowner|oprprec|oprkind|oprisleft|oprcanhash|oprleft|oprright|oprresult|oprcom|oprnegate|oprlsortop|oprrsortop|oprcode|oprrest|oprjoin
|
|
---+-------+--------+-------+-------+---------+----------+-------+--------+---------+------+---------+----------+----------+-------+-------+-------
|
|
(0 rows)
|
|
|
|
QUERY: SELECT p1.oid, p1.* FROM pg_operator AS p1
|
|
WHERE p1.oprresult != 0 AND NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = p1.oprresult);
|
|
oid|oprname|oprowner|oprprec|oprkind|oprisleft|oprcanhash|oprleft|oprright|oprresult|oprcom|oprnegate|oprlsortop|oprrsortop|oprcode|oprrest|oprjoin
|
|
---+-------+--------+-------+-------+---------+----------+-------+--------+---------+------+---------+----------+----------+-------+-------+-------
|
|
(0 rows)
|
|
|
|
QUERY: SELECT p1.oid, p1.* FROM pg_operator AS p1
|
|
WHERE p1.oprcom != 0 AND NOT
|
|
EXISTS(SELECT * FROM pg_operator AS p2 WHERE p2.oid = p1.oprcom);
|
|
oid|oprname|oprowner|oprprec|oprkind|oprisleft|oprcanhash|oprleft|oprright|oprresult|oprcom|oprnegate|oprlsortop|oprrsortop|oprcode|oprrest|oprjoin
|
|
---+-------+--------+-------+-------+---------+----------+-------+--------+---------+------+---------+----------+----------+-------+-------+-------
|
|
(0 rows)
|
|
|
|
QUERY: SELECT p1.oid, p1.* FROM pg_operator AS p1
|
|
WHERE p1.oprnegate != 0 AND NOT
|
|
EXISTS(SELECT * FROM pg_operator AS p2 WHERE p2.oid = p1.oprnegate);
|
|
oid|oprname|oprowner|oprprec|oprkind|oprisleft|oprcanhash|oprleft|oprright|oprresult|oprcom|oprnegate|oprlsortop|oprrsortop|oprcode|oprrest|oprjoin
|
|
---+-------+--------+-------+-------+---------+----------+-------+--------+---------+------+---------+----------+----------+-------+-------+-------
|
|
(0 rows)
|
|
|
|
QUERY: SELECT p1.oid, p1.* FROM pg_operator AS p1
|
|
WHERE p1.oprlsortop != 0 AND NOT
|
|
EXISTS(SELECT * FROM pg_operator AS p2 WHERE p2.oid = p1.oprlsortop);
|
|
oid|oprname|oprowner|oprprec|oprkind|oprisleft|oprcanhash|oprleft|oprright|oprresult|oprcom|oprnegate|oprlsortop|oprrsortop|oprcode|oprrest|oprjoin
|
|
---+-------+--------+-------+-------+---------+----------+-------+--------+---------+------+---------+----------+----------+-------+-------+-------
|
|
(0 rows)
|
|
|
|
QUERY: SELECT p1.oid, p1.* FROM pg_operator AS p1
|
|
WHERE p1.oprrsortop != 0 AND NOT
|
|
EXISTS(SELECT * FROM pg_operator AS p2 WHERE p2.oid = p1.oprrsortop);
|
|
oid|oprname|oprowner|oprprec|oprkind|oprisleft|oprcanhash|oprleft|oprright|oprresult|oprcom|oprnegate|oprlsortop|oprrsortop|oprcode|oprrest|oprjoin
|
|
---+-------+--------+-------+-------+---------+----------+-------+--------+---------+------+---------+----------+----------+-------+-------+-------
|
|
(0 rows)
|
|
|
|
QUERY: SELECT p1.oid, p1.oprcode, p2.oid, p2.oprcode
|
|
FROM pg_operator AS p1, pg_operator AS p2
|
|
WHERE p1.oid != p2.oid AND
|
|
p1.oprname = p2.oprname AND
|
|
p1.oprkind = p2.oprkind AND
|
|
p1.oprleft = p2.oprleft AND
|
|
p1.oprright = p2.oprright;
|
|
oid|oprcode|oid|oprcode
|
|
---+-------+---+-------
|
|
(0 rows)
|
|
|
|
QUERY: SELECT p1.oid, p1.oprcode, p2.oid, p2.oprcode
|
|
FROM pg_operator AS p1, pg_operator AS p2
|
|
WHERE p1.oprcom = p2.oid AND
|
|
(p1.oprkind != 'b' OR
|
|
p1.oprleft != p2.oprright OR
|
|
p1.oprright != p2.oprleft OR
|
|
p1.oprresult != p2.oprresult OR
|
|
p1.oid != p2.oprcom);
|
|
oid|oprcode|oid|oprcode
|
|
---+-------+---+-------
|
|
(0 rows)
|
|
|
|
QUERY: SELECT p1.oid, p1.oprcode, p2.oid, p2.oprcode
|
|
FROM pg_operator AS p1, pg_operator AS p2
|
|
WHERE p1.oprnegate = p2.oid AND
|
|
(p1.oprkind != p2.oprkind OR
|
|
p1.oprleft != p2.oprleft OR
|
|
p1.oprright != p2.oprright OR
|
|
p1.oprresult != 16 OR
|
|
p2.oprresult != 16 OR
|
|
p1.oid != p2.oprnegate);
|
|
oid|oprcode|oid|oprcode
|
|
---+-------+---+-------
|
|
(0 rows)
|
|
|
|
QUERY: SELECT p1.oid, p1.oprcode, p2.oid, p2.oprcode
|
|
FROM pg_operator AS p1, pg_operator AS p2
|
|
WHERE p1.oprlsortop = p2.oid AND
|
|
(p1.oprname != '=' OR p2.oprname != '<' OR
|
|
p1.oprkind != 'b' OR p2.oprkind != 'b' OR
|
|
p1.oprleft != p2.oprleft OR
|
|
p1.oprleft != p2.oprright OR
|
|
p1.oprresult != 16 OR
|
|
p2.oprresult != 16 OR
|
|
p1.oprrsortop = 0);
|
|
oid|oprcode|oid|oprcode
|
|
---+-------+---+-------
|
|
(0 rows)
|
|
|
|
QUERY: SELECT p1.oid, p1.oprcode, p2.oid, p2.oprcode
|
|
FROM pg_operator AS p1, pg_operator AS p2
|
|
WHERE p1.oprrsortop = p2.oid AND
|
|
(p1.oprname != '=' OR p2.oprname != '<' OR
|
|
p1.oprkind != 'b' OR p2.oprkind != 'b' OR
|
|
p1.oprright != p2.oprleft OR
|
|
p1.oprright != p2.oprright OR
|
|
p1.oprresult != 16 OR
|
|
p2.oprresult != 16 OR
|
|
p1.oprlsortop = 0);
|
|
oid|oprcode|oid|oprcode
|
|
---+-------+---+-------
|
|
(0 rows)
|
|
|
|
QUERY: SELECT p1.oid, p1.* FROM pg_operator AS p1
|
|
WHERE p1.oprlsortop != 0 AND
|
|
p1.oprcom = 0;
|
|
oid|oprname|oprowner|oprprec|oprkind|oprisleft|oprcanhash|oprleft|oprright|oprresult|oprcom|oprnegate|oprlsortop|oprrsortop|oprcode|oprrest|oprjoin
|
|
---+-------+--------+-------+-------+---------+----------+-------+--------+---------+------+---------+----------+----------+-------+-------+-------
|
|
(0 rows)
|
|
|
|
QUERY: SELECT p1.oid, p1.* FROM pg_operator AS p1
|
|
WHERE p1.oprlsortop != 0 AND NOT
|
|
EXISTS(SELECT * FROM pg_operator AS p2 WHERE
|
|
p2.oprname = '<' AND
|
|
p2.oprleft = p1.oprleft AND
|
|
p2.oprright = p1.oprright AND
|
|
p2.oprkind = 'b');
|
|
oid|oprname|oprowner|oprprec|oprkind|oprisleft|oprcanhash|oprleft|oprright|oprresult|oprcom|oprnegate|oprlsortop|oprrsortop|oprcode|oprrest|oprjoin
|
|
---+-------+--------+-------+-------+---------+----------+-------+--------+---------+------+---------+----------+----------+-------+-------+-------
|
|
(0 rows)
|
|
|
|
QUERY: SELECT p1.oid, p1.* FROM pg_operator AS p1
|
|
WHERE p1.oprlsortop != 0 AND NOT
|
|
EXISTS(SELECT * FROM pg_operator AS p2 WHERE
|
|
p2.oprname = '>' AND
|
|
p2.oprleft = p1.oprleft AND
|
|
p2.oprright = p1.oprright AND
|
|
p2.oprkind = 'b');
|
|
oid|oprname|oprowner|oprprec|oprkind|oprisleft|oprcanhash|oprleft|oprright|oprresult|oprcom|oprnegate|oprlsortop|oprrsortop|oprcode|oprrest|oprjoin
|
|
---+-------+--------+-------+-------+---------+----------+-------+--------+---------+------+---------+----------+----------+-------+-------+-------
|
|
(0 rows)
|
|
|