> SELECT TEST.ID FROM TABLE_DISTINCT(TEMP_VIEW_22_X INTEGER=(1, 2, NULL)) TEMP_VIEW_23 /* PUBLIC."" */ INNER JOIN PUBLIC.TEST /* PUBLIC.PRIMARY_KEY_2: ID >= 1 AND ID <= 2 AND ID = TEMP_VIEW_23.TEMP_VIEW_22_X */ ON 1=1 WHERE (ID IN(1, 2, NULL)) AND (ID = TEMP_VIEW_23.TEMP_VIEW_22_X)
> SELECT TEST.ID FROM TABLE_DISTINCT(TEMP_VIEW_23_X INTEGER=(1, 2, NULL)) TEMP_VIEW_24 /* PUBLIC."" */ INNER JOIN PUBLIC.TEST /* PUBLIC.PRIMARY_KEY_2: ID >= 1 AND ID <= 2 AND ID = TEMP_VIEW_24.TEMP_VIEW_23_X */ ON 1=1 WHERE (ID IN(1, 2, NULL)) AND (ID = TEMP_VIEW_24.TEMP_VIEW_23_X)
> rows: 1
drop table test;
...
...
@@ -2597,7 +2600,7 @@ select * from test t1 where id in(id);
explain select * from test t1 where id in(select id from test);
> SELECT T1.ID, T1.NAME FROM (SELECT DISTINCT ID AS TEMP_VIEW_72_X FROM PUBLIC.TEST /* PUBLIC.TEST_TABLE_SCAN */) TEMP_VIEW_73 /* SELECT DISTINCT ID AS TEMP_VIEW_72_X FROM PUBLIC.TEST /++ PUBLIC.TEST_TABLE_SCAN ++/ */ INNER JOIN PUBLIC.TEST T1 /* PUBLIC.PRIMARY_KEY_2: ID = TEMP_VIEW_73.TEMP_VIEW_72_X */ ON 1=1 WHERE ID = TEMP_VIEW_73.TEMP_VIEW_72_X
> SELECT T1.ID, T1.NAME FROM (SELECT DISTINCT ID AS TEMP_VIEW_73_X FROM PUBLIC.TEST /* PUBLIC.TEST_TABLE_SCAN */) TEMP_VIEW_74 /* SELECT DISTINCT ID AS TEMP_VIEW_73_X FROM PUBLIC.TEST /++ PUBLIC.TEST_TABLE_SCAN ++/ */ INNER JOIN PUBLIC.TEST T1 /* PUBLIC.PRIMARY_KEY_2: ID = TEMP_VIEW_74.TEMP_VIEW_73_X */ ON 1=1 WHERE ID = TEMP_VIEW_74.TEMP_VIEW_73_X
> rows: 1
select * from test t1 where id in(select id from test);
...
...
@@ -2610,7 +2613,7 @@ select * from test t1 where id in(select id from test);
explain select * from test t1 where id in(1, select max(id) from test);
> SELECT T1.ID, T1.NAME FROM TABLE_DISTINCT(TEMP_VIEW_80_X INTEGER=(1, 2)) TEMP_VIEW_81 /* PUBLIC."" */ INNER JOIN PUBLIC.TEST T1 /* PUBLIC.PRIMARY_KEY_2: ID >= 1 AND ID <= 2 AND ID = TEMP_VIEW_81.TEMP_VIEW_80_X */ ON 1=1 WHERE (ID IN(1, 2)) AND (ID = TEMP_VIEW_81.TEMP_VIEW_80_X)
> SELECT T1.ID, T1.NAME FROM TABLE_DISTINCT(TEMP_VIEW_81_X INTEGER=(1, 2)) TEMP_VIEW_82 /* PUBLIC."" */ INNER JOIN PUBLIC.TEST T1 /* PUBLIC.PRIMARY_KEY_2: ID >= 1 AND ID <= 2 AND ID = TEMP_VIEW_82.TEMP_VIEW_81_X */ ON 1=1 WHERE (ID IN(1, 2)) AND (ID = TEMP_VIEW_82.TEMP_VIEW_81_X)
> rows: 1
select * from test t1 where id in(1, select max(id) from test);
...
...
@@ -5513,13 +5516,13 @@ EXPLAIN PLAN FOR SELECT * FROM TEST T1 WHERE EXISTS(SELECT * FROM TEST T2 WHERE
EXPLAIN PLAN FOR SELECT * FROM TEST T1 WHERE ID IN(1, 2);
> SELECT T1.ID, T1.NAME FROM TABLE_DISTINCT(TEMP_VIEW_117_X INTEGER=(1, 2)) TEMP_VIEW_118 /* PUBLIC."" */ INNER JOIN PUBLIC.TEST T1 /* PUBLIC.PRIMARY_KEY_2: ID >= 1 AND ID <= 2 AND ID = TEMP_VIEW_118.TEMP_VIEW_117_X */ ON 1=1 WHERE (ID IN(1, 2)) AND (ID = TEMP_VIEW_118.TEMP_VIEW_117_X)
> SELECT T1.ID, T1.NAME FROM TABLE_DISTINCT(TEMP_VIEW_118_X INTEGER=(1, 2)) TEMP_VIEW_119 /* PUBLIC."" */ INNER JOIN PUBLIC.TEST T1 /* PUBLIC.PRIMARY_KEY_2: ID >= 1 AND ID <= 2 AND ID = TEMP_VIEW_119.TEMP_VIEW_118_X */ ON 1=1 WHERE (ID IN(1, 2)) AND (ID = TEMP_VIEW_119.TEMP_VIEW_118_X)
> rows: 1
EXPLAIN PLAN FOR SELECT * FROM TEST T1 WHERE ID IN(SELECT ID FROM TEST);
> SELECT T1.ID, T1.NAME FROM (SELECT DISTINCT ID AS TEMP_VIEW_121_X FROM PUBLIC.TEST /* PUBLIC.TEST_TABLE_SCAN */) TEMP_VIEW_122 /* SELECT DISTINCT ID AS TEMP_VIEW_121_X FROM PUBLIC.TEST /++ PUBLIC.TEST_TABLE_SCAN ++/ */ INNER JOIN PUBLIC.TEST T1 /* PUBLIC.PRIMARY_KEY_2: ID = TEMP_VIEW_122.TEMP_VIEW_121_X */ ON 1=1 WHERE ID = TEMP_VIEW_122.TEMP_VIEW_121_X
> SELECT T1.ID, T1.NAME FROM (SELECT DISTINCT ID AS TEMP_VIEW_122_X FROM PUBLIC.TEST /* PUBLIC.TEST_TABLE_SCAN */) TEMP_VIEW_123 /* SELECT DISTINCT ID AS TEMP_VIEW_122_X FROM PUBLIC.TEST /++ PUBLIC.TEST_TABLE_SCAN ++/ */ INNER JOIN PUBLIC.TEST T1 /* PUBLIC.PRIMARY_KEY_2: ID = TEMP_VIEW_123.TEMP_VIEW_122_X */ ON 1=1 WHERE ID = TEMP_VIEW_123.TEMP_VIEW_122_X
> rows: 1
EXPLAIN PLAN FOR SELECT * FROM TEST T1 WHERE ID NOT IN(SELECT ID FROM TEST);