create schema prepare_index_con;
set current_schema to 'prepare_index_con';
create table test1(c1 int1, c2 int2, c3 int4, c4 int8, c5 uint1, c6 uint2, c7 uint4, c8 uint8);
insert into test1 values (generate_series(0, 100), generate_series(0, 100), generate_series(0, 100), generate_series(0, 100), generate_series(0, 100), generate_series(0, 100), generate_series(0, 100), generate_series(0, 100));
create index idx1 on test1(c1);
create index idx2 on test1(c2);
create index idx3 on test1(c3);
create index idx4 on test1(c4);
create index idx5 on test1(c5);
create index idx6 on test1(c6);
create index idx7 on test1(c7);
create index idx8 on test1(c8);
create index idx9 on test1(c2, c3);
create index idx10 on test1(c2, c3, c4);
create index idx11 on test1(c4, c3, c2);
analyze test1;
set enable_seqscan = off;
set dolphin.transform_unknown_param_type_as_column_type_first = true;
prepare s1 as select * from test1 where c1 = ?;
explain (costs off) execute s1 using 1;
QUERY PLAN
--------------------------------
[Bypass]
Index Scan using idx1 on test1
Index Cond: (c1 = $1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
--------------------------------
[Bypass]
Index Scan using idx1 on test1
Index Cond: (c1 = $1)
(3 rows)
prepare s1 as select * from test1 where ? = c1;
explain (costs off) execute s1 using 1;
QUERY PLAN
--------------------------------
[Bypass]
Index Scan using idx1 on test1
Index Cond: ($1 = c1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
--------------------------------
[Bypass]
Index Scan using idx1 on test1
Index Cond: ($1 = c1)
(3 rows)
prepare s1 as select * from test1 where c2 = ?;
explain (costs off) execute s1 using 1;
QUERY PLAN
---------------------------------
[Bypass]
Index Scan using idx10 on test1
Index Cond: (c2 = $1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
---------------------------------
[Bypass]
Index Scan using idx10 on test1
Index Cond: (c2 = $1)
(3 rows)
prepare s1 as select * from test1 where ? = c2;
explain (costs off) execute s1 using 1;
QUERY PLAN
---------------------------------
[Bypass]
Index Scan using idx10 on test1
Index Cond: ($1 = c2)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
---------------------------------
[Bypass]
Index Scan using idx10 on test1
Index Cond: ($1 = c2)
(3 rows)
prepare s1 as select * from test1 where c3 = ?;
explain (costs off) execute s1 using 1;
QUERY PLAN
--------------------------------
[Bypass]
Index Scan using idx3 on test1
Index Cond: (c3 = $1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
--------------------------------
[Bypass]
Index Scan using idx3 on test1
Index Cond: (c3 = $1)
(3 rows)
prepare s1 as select * from test1 where ? = c3;
explain (costs off) execute s1 using 1;
QUERY PLAN
--------------------------------
[Bypass]
Index Scan using idx3 on test1
Index Cond: ($1 = c3)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
--------------------------------
[Bypass]
Index Scan using idx3 on test1
Index Cond: ($1 = c3)
(3 rows)
prepare s1 as select * from test1 where c4 = ?;
explain (costs off) execute s1 using 1;
QUERY PLAN
---------------------------------
[Bypass]
Index Scan using idx11 on test1
Index Cond: (c4 = $1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
---------------------------------
[Bypass]
Index Scan using idx11 on test1
Index Cond: (c4 = $1)
(3 rows)
prepare s1 as select * from test1 where ? = c4;
explain (costs off) execute s1 using 1;
QUERY PLAN
---------------------------------
[Bypass]
Index Scan using idx11 on test1
Index Cond: ($1 = c4)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
---------------------------------
[Bypass]
Index Scan using idx11 on test1
Index Cond: ($1 = c4)
(3 rows)
prepare s1 as select * from test1 where c5 = ?;
explain (costs off) execute s1 using 1;
QUERY PLAN
--------------------------------
[Bypass]
Index Scan using idx5 on test1
Index Cond: (c5 = $1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
--------------------------------
[Bypass]
Index Scan using idx5 on test1
Index Cond: (c5 = $1)
(3 rows)
prepare s1 as select * from test1 where ? = c5;
explain (costs off) execute s1 using 1;
QUERY PLAN
--------------------------------
[Bypass]
Index Scan using idx5 on test1
Index Cond: ($1 = c5)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
--------------------------------
[Bypass]
Index Scan using idx5 on test1
Index Cond: ($1 = c5)
(3 rows)
prepare s1 as select * from test1 where c6 = ?;
explain (costs off) execute s1 using 1;
QUERY PLAN
--------------------------------
[Bypass]
Index Scan using idx6 on test1
Index Cond: (c6 = $1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
--------------------------------
[Bypass]
Index Scan using idx6 on test1
Index Cond: (c6 = $1)
(3 rows)
prepare s1 as select * from test1 where ? = c6;
explain (costs off) execute s1 using 1;
QUERY PLAN
--------------------------------
[Bypass]
Index Scan using idx6 on test1
Index Cond: ($1 = c6)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
--------------------------------
[Bypass]
Index Scan using idx6 on test1
Index Cond: ($1 = c6)
(3 rows)
prepare s1 as select * from test1 where c7 = ?;
explain (costs off) execute s1 using 1;
QUERY PLAN
--------------------------------
[Bypass]
Index Scan using idx7 on test1
Index Cond: (c7 = $1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
--------------------------------
[Bypass]
Index Scan using idx7 on test1
Index Cond: (c7 = $1)
(3 rows)
prepare s1 as select * from test1 where ? = c7;
explain (costs off) execute s1 using 1;
QUERY PLAN
--------------------------------
[Bypass]
Index Scan using idx7 on test1
Index Cond: ($1 = c7)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
--------------------------------
[Bypass]
Index Scan using idx7 on test1
Index Cond: ($1 = c7)
(3 rows)
prepare s1 as select * from test1 where c8 = ?;
explain (costs off) execute s1 using 1;
QUERY PLAN
--------------------------------
[Bypass]
Index Scan using idx8 on test1
Index Cond: (c8 = $1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
--------------------------------
[Bypass]
Index Scan using idx8 on test1
Index Cond: (c8 = $1)
(3 rows)
prepare s1 as select * from test1 where ? = c8;
explain (costs off) execute s1 using 1;
QUERY PLAN
--------------------------------
[Bypass]
Index Scan using idx8 on test1
Index Cond: ($1 = c8)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
--------------------------------
[Bypass]
Index Scan using idx8 on test1
Index Cond: ($1 = c8)
(3 rows)
prepare s1 as select * from test1 where c2 = ? and c3 = ? and c4 = ?;
explain (costs off) execute s1 using 1, 2, 3;
QUERY PLAN
-------------------------------------------------------
[Bypass]
Index Scan using idx11 on test1
Index Cond: ((c4 = $3) AND (c3 = $2) AND (c2 = $1))
(3 rows)
explain (costs off) execute s1 using 1.23, 1.23, 1.23;
QUERY PLAN
-------------------------------------------------------
[Bypass]
Index Scan using idx11 on test1
Index Cond: ((c4 = $3) AND (c3 = $2) AND (c2 = $1))
(3 rows)
prepare s1 as select * from test1 where c4 = ? and c3 = ? and c2 = ?;
explain (costs off) execute s1 using 1, 2, 3;
QUERY PLAN
-------------------------------------------------------
[Bypass]
Index Scan using idx11 on test1
Index Cond: ((c4 = $1) AND (c3 = $2) AND (c2 = $3))
(3 rows)
explain (costs off) execute s1 using 1.23, 1.23, 1.23;
QUERY PLAN
-------------------------------------------------------
[Bypass]
Index Scan using idx11 on test1
Index Cond: ((c4 = $1) AND (c3 = $2) AND (c2 = $3))
(3 rows)
prepare s1 as select * from test1 where c2 = ? and c3 = ?;
explain (costs off) execute s1 using 1, 2;
QUERY PLAN
-----------------------------------------
[Bypass]
Index Scan using idx10 on test1
Index Cond: ((c2 = $1) AND (c3 = $2))
(3 rows)
explain (costs off) execute s1 using 1.23, 1.23;
QUERY PLAN
-----------------------------------------
[Bypass]
Index Scan using idx10 on test1
Index Cond: ((c2 = $1) AND (c3 = $2))
(3 rows)
prepare s1 as select * from test1 where c2 = ? and c4 = ?;
explain (costs off) execute s1 using 1, 2;
QUERY PLAN
-----------------------------------------
[Bypass]
Index Scan using idx11 on test1
Index Cond: ((c4 = $2) AND (c2 = $1))
(3 rows)
explain (costs off) execute s1 using 1.23, 1.23;
QUERY PLAN
-----------------------------------------
[Bypass]
Index Scan using idx11 on test1
Index Cond: ((c4 = $2) AND (c2 = $1))
(3 rows)
prepare s1 as select * from test1 where c2 = ? + ? - ?;
explain (costs off) execute s1 using 1, 2, 3;
QUERY PLAN
---------------------------------------------------
Index Scan using idx10 on test1
Index Cond: (c2 = ((($1 + $2) - $3))::smallint)
(2 rows)
explain (costs off) execute s1 using 1.23, 1.23, 1.23;
QUERY PLAN
---------------------------------------------------
Index Scan using idx10 on test1
Index Cond: (c2 = ((($1 + $2) - $3))::smallint)
(2 rows)
create table test_type_table
(
a_int1 tinyint,
a_uint1 tinyint unsigned,
a_int2 smallint,
a_uint2 smallint unsigned,
a_int4 integer,
a_uint4 integer unsigned,
a_int8 bigint,
a_uint8 bigint unsigned,
a_float4 float4,
a_float8 float8,
a_numeric decimal(20, 6),
a_bit1 bit(1),
a_bit64 bit(64),
a_boolean boolean,
a_date date,
a_time time,
a_datetime datetime,
a_timestamp timestamp,
a_year year,
a_char char(100),
a_varchar varchar(100),
a_binary binary(100),
a_varbinary varbinary(100),
a_tinyblob tinyblob,
a_blob blob,
a_mediumblob mediumblob,
a_longblob longblob,
a_text text
);
insert into test_type_table values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, b'1', b'111', true, '2023-02-05', '19:10:50', '2023-02-05 19:10:50', '2023-02-05 19:10:50', '2023', '1.23a', '1.23a', '1.23a', '1.23a', '1.23a', '1.23a', '1.23a', '1.23a', '1.23a');
create index a_id1 on test_type_table(a_int1);
create index a_id2 on test_type_table(a_uint1);
create index a_id3 on test_type_table(a_int2);
create index a_id4 on test_type_table(a_uint2);
create index a_id5 on test_type_table(a_int4);
create index a_id6 on test_type_table(a_uint4);
create index a_id7 on test_type_table(a_int8);
create index a_id8 on test_type_table(a_uint8);
create index a_id9 on test_type_table(a_float4);
create index a_id10 on test_type_table(a_float8);
create index a_id12 on test_type_table(a_numeric);
create index a_id13 on test_type_table(a_bit1);
create index a_id14 on test_type_table(a_bit64);
create index a_id15 on test_type_table(a_boolean);
create index a_id16 on test_type_table(a_date);
create index a_id17 on test_type_table(a_time);
create index a_id18 on test_type_table(a_datetime);
create index a_id18 on test_type_table(a_timestamp);
WARNING: index "a_id18" already exists, change index name to "test_type_table_a_timestamp_idx"
create index a_id18 on test_type_table(a_year);
WARNING: index "a_id18" already exists, change index name to "test_type_table_a_year_idx"
create index a_id18 on test_type_table(a_char);
WARNING: index "a_id18" already exists, change index name to "test_type_table_a_char_idx"
create index a_id18 on test_type_table(a_varchar);
WARNING: index "a_id18" already exists, change index name to "test_type_table_a_varchar_idx"
create index a_id18 on test_type_table(a_binary);
WARNING: index "a_id18" already exists, change index name to "test_type_table_a_binary_idx"
create index a_id18 on test_type_table(a_varbinary);
WARNING: index "a_id18" already exists, change index name to "test_type_table_a_varbinary_idx"
create index a_id18 on test_type_table(a_tinyblob);
WARNING: index "a_id18" already exists, change index name to "test_type_table_a_tinyblob_idx"
create index a_id18 on test_type_table(a_blob);
WARNING: index "a_id18" already exists, change index name to "test_type_table_a_blob_idx"
create index a_id18 on test_type_table(a_mediumblob);
WARNING: index "a_id18" already exists, change index name to "test_type_table_a_mediumblob_idx"
create index a_id18 on test_type_table(a_longblob);
WARNING: index "a_id18" already exists, change index name to "test_type_table_a_longblob_idx"
create index a_id18 on test_type_table(a_text);
WARNING: index "a_id18" already exists, change index name to "test_type_table_a_text_idx"
prepare s1 as select * from test_type_table where a_int1 = ?;
explain (costs off) execute s1 using 1;
QUERY PLAN
-------------------------------------------
[Bypass]
Index Scan using a_id1 on test_type_table
Index Cond: (a_int1 = $1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
-------------------------------------------
[Bypass]
Index Scan using a_id1 on test_type_table
Index Cond: (a_int1 = $1)
(3 rows)
explain (costs off) execute s1 using '1';
QUERY PLAN
-------------------------------------------
[Bypass]
Index Scan using a_id1 on test_type_table
Index Cond: (a_int1 = $1)
(3 rows)
prepare s1 as select * from test_type_table where a_uint1 = ?;
explain (costs off) execute s1 using 1;
QUERY PLAN
-------------------------------------------
[Bypass]
Index Scan using a_id2 on test_type_table
Index Cond: (a_uint1 = $1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
-------------------------------------------
[Bypass]
Index Scan using a_id2 on test_type_table
Index Cond: (a_uint1 = $1)
(3 rows)
explain (costs off) execute s1 using '1';
QUERY PLAN
-------------------------------------------
[Bypass]
Index Scan using a_id2 on test_type_table
Index Cond: (a_uint1 = $1)
(3 rows)
prepare s1 as select * from test_type_table where a_int2 = ?;
explain (costs off) execute s1 using 1;
QUERY PLAN
-------------------------------------------
[Bypass]
Index Scan using a_id3 on test_type_table
Index Cond: (a_int2 = $1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
-------------------------------------------
[Bypass]
Index Scan using a_id3 on test_type_table
Index Cond: (a_int2 = $1)
(3 rows)
explain (costs off) execute s1 using '1';
QUERY PLAN
-------------------------------------------
[Bypass]
Index Scan using a_id3 on test_type_table
Index Cond: (a_int2 = $1)
(3 rows)
prepare s1 as select * from test_type_table where a_uint2 = ?;
explain (costs off) execute s1 using 1;
QUERY PLAN
-------------------------------------------
[Bypass]
Index Scan using a_id4 on test_type_table
Index Cond: (a_uint2 = $1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
-------------------------------------------
[Bypass]
Index Scan using a_id4 on test_type_table
Index Cond: (a_uint2 = $1)
(3 rows)
explain (costs off) execute s1 using '1';
QUERY PLAN
-------------------------------------------
[Bypass]
Index Scan using a_id4 on test_type_table
Index Cond: (a_uint2 = $1)
(3 rows)
prepare s1 as select * from test_type_table where a_int4 = ?;
explain (costs off) execute s1 using 1;
QUERY PLAN
-------------------------------------------
[Bypass]
Index Scan using a_id5 on test_type_table
Index Cond: (a_int4 = $1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
-------------------------------------------
[Bypass]
Index Scan using a_id5 on test_type_table
Index Cond: (a_int4 = $1)
(3 rows)
explain (costs off) execute s1 using '1';
QUERY PLAN
-------------------------------------------
[Bypass]
Index Scan using a_id5 on test_type_table
Index Cond: (a_int4 = $1)
(3 rows)
prepare s1 as select * from test_type_table where a_uint4 = ?;
explain (costs off) execute s1 using 1;
QUERY PLAN
-------------------------------------------
[Bypass]
Index Scan using a_id6 on test_type_table
Index Cond: (a_uint4 = $1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
-------------------------------------------
[Bypass]
Index Scan using a_id6 on test_type_table
Index Cond: (a_uint4 = $1)
(3 rows)
explain (costs off) execute s1 using '1';
QUERY PLAN
-------------------------------------------
[Bypass]
Index Scan using a_id6 on test_type_table
Index Cond: (a_uint4 = $1)
(3 rows)
prepare s1 as select * from test_type_table where a_int8 = ?;
explain (costs off) execute s1 using 1;
QUERY PLAN
-------------------------------------------
[Bypass]
Index Scan using a_id7 on test_type_table
Index Cond: (a_int8 = $1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
-------------------------------------------
[Bypass]
Index Scan using a_id7 on test_type_table
Index Cond: (a_int8 = $1)
(3 rows)
explain (costs off) execute s1 using '1';
QUERY PLAN
-------------------------------------------
[Bypass]
Index Scan using a_id7 on test_type_table
Index Cond: (a_int8 = $1)
(3 rows)
prepare s1 as select * from test_type_table where a_uint8 = ?;
explain (costs off) execute s1 using 1;
QUERY PLAN
-------------------------------------------
[Bypass]
Index Scan using a_id8 on test_type_table
Index Cond: (a_uint8 = $1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
-------------------------------------------
[Bypass]
Index Scan using a_id8 on test_type_table
Index Cond: (a_uint8 = $1)
(3 rows)
explain (costs off) execute s1 using '1';
QUERY PLAN
-------------------------------------------
[Bypass]
Index Scan using a_id8 on test_type_table
Index Cond: (a_uint8 = $1)
(3 rows)
prepare s1 as select * from test_type_table where a_float4 = ?;
explain (costs off) execute s1 using 1;
QUERY PLAN
-------------------------------------------
[Bypass]
Index Scan using a_id9 on test_type_table
Index Cond: (a_float4 = $1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
-------------------------------------------
[Bypass]
Index Scan using a_id9 on test_type_table
Index Cond: (a_float4 = $1)
(3 rows)
explain (costs off) execute s1 using '1';
QUERY PLAN
-------------------------------------------
[Bypass]
Index Scan using a_id9 on test_type_table
Index Cond: (a_float4 = $1)
(3 rows)
prepare s1 as select * from test_type_table where a_float8 = ?;
explain (costs off) execute s1 using 1;
QUERY PLAN
--------------------------------------------
[Bypass]
Index Scan using a_id10 on test_type_table
Index Cond: (a_float8 = $1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
--------------------------------------------
[Bypass]
Index Scan using a_id10 on test_type_table
Index Cond: (a_float8 = $1)
(3 rows)
explain (costs off) execute s1 using '1';
QUERY PLAN
--------------------------------------------
[Bypass]
Index Scan using a_id10 on test_type_table
Index Cond: (a_float8 = $1)
(3 rows)
prepare s1 as select * from test_type_table where a_numeric = ?;
explain (costs off) execute s1 using 1;
QUERY PLAN
--------------------------------------------
[Bypass]
Index Scan using a_id12 on test_type_table
Index Cond: (a_numeric = $1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
--------------------------------------------
[Bypass]
Index Scan using a_id12 on test_type_table
Index Cond: (a_numeric = $1)
(3 rows)
explain (costs off) execute s1 using '1';
QUERY PLAN
--------------------------------------------
[Bypass]
Index Scan using a_id12 on test_type_table
Index Cond: (a_numeric = $1)
(3 rows)
prepare s1 as select * from test_type_table where a_bit1 = ?;
explain (costs off) execute s1 using 1;
QUERY PLAN
--------------------------------------------
[Bypass]
Index Scan using a_id13 on test_type_table
Index Cond: (a_bit1 = $1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
--------------------------------------------
[Bypass]
Index Scan using a_id13 on test_type_table
Index Cond: (a_bit1 = $1)
(3 rows)
explain (costs off) execute s1 using '1';
QUERY PLAN
--------------------------------------------
[Bypass]
Index Scan using a_id13 on test_type_table
Index Cond: (a_bit1 = $1)
(3 rows)
prepare s1 as select * from test_type_table where a_bit64 = ?;
explain (costs off) execute s1 using 1;
QUERY PLAN
--------------------------------------------
[Bypass]
Index Scan using a_id14 on test_type_table
Index Cond: (a_bit64 = $1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
--------------------------------------------
[Bypass]
Index Scan using a_id14 on test_type_table
Index Cond: (a_bit64 = $1)
(3 rows)
explain (costs off) execute s1 using '1';
QUERY PLAN
--------------------------------------------
[Bypass]
Index Scan using a_id14 on test_type_table
Index Cond: (a_bit64 = $1)
(3 rows)
prepare s1 as select * from test_type_table where a_boolean = ?;
explain (costs off) execute s1 using 1;
QUERY PLAN
--------------------------------------------
[Bypass]
Index Scan using a_id15 on test_type_table
Index Cond: (a_boolean = $1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
--------------------------------------------
[Bypass]
Index Scan using a_id15 on test_type_table
Index Cond: (a_boolean = $1)
(3 rows)
explain (costs off) execute s1 using '1';
QUERY PLAN
--------------------------------------------
[Bypass]
Index Scan using a_id15 on test_type_table
Index Cond: (a_boolean = $1)
(3 rows)
prepare s1 as select * from test_type_table where a_date = ?;
explain (costs off) execute s1 using '2024-10-10';
QUERY PLAN
--------------------------------------------
[Bypass]
Index Scan using a_id16 on test_type_table
Index Cond: (a_date = $1)
(3 rows)
prepare s1 as select * from test_type_table where a_datetime = ?;
explain (costs off) execute s1 using '2024-10-10 10:10:10';
QUERY PLAN
--------------------------------------------
[Bypass]
Index Scan using a_id18 on test_type_table
Index Cond: (a_datetime = $1)
(3 rows)
prepare s1 as select * from test_type_table where a_timestamp = ?;
explain (costs off) execute s1 using '2024-10-10 10:10:10';
QUERY PLAN
---------------------------------------------------------------------
[Bypass]
Index Scan using test_type_table_a_timestamp_idx on test_type_table
Index Cond: (a_timestamp = $1)
(3 rows)
prepare s1 as select * from test_type_table where a_year = ?;
explain (costs off) execute s1 using 1;
QUERY PLAN
----------------------------------------------------------------
[Bypass]
Index Scan using test_type_table_a_year_idx on test_type_table
Index Cond: (a_year = $1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
----------------------------------------------------------------
[Bypass]
Index Scan using test_type_table_a_year_idx on test_type_table
Index Cond: (a_year = $1)
(3 rows)
explain (costs off) execute s1 using '1';
QUERY PLAN
----------------------------------------------------------------
[Bypass]
Index Scan using test_type_table_a_year_idx on test_type_table
Index Cond: (a_year = $1)
(3 rows)
prepare s1 as select * from test_type_table where a_char = ?;
explain (costs off) execute s1 using 1;
QUERY PLAN
----------------------------------------------------------------
[Bypass]
Index Scan using test_type_table_a_char_idx on test_type_table
Index Cond: (a_char = $1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
----------------------------------------------------------------
[Bypass]
Index Scan using test_type_table_a_char_idx on test_type_table
Index Cond: (a_char = $1)
(3 rows)
explain (costs off) execute s1 using '1';
QUERY PLAN
----------------------------------------------------------------
[Bypass]
Index Scan using test_type_table_a_char_idx on test_type_table
Index Cond: (a_char = $1)
(3 rows)
prepare s1 as select * from test_type_table where a_varchar = ?;
explain (costs off) execute s1 using 1;
QUERY PLAN
-------------------------------------------------------------------
[Bypass]
Index Scan using test_type_table_a_varchar_idx on test_type_table
Index Cond: ((a_varchar)::text = $1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
-------------------------------------------------------------------
[Bypass]
Index Scan using test_type_table_a_varchar_idx on test_type_table
Index Cond: ((a_varchar)::text = $1)
(3 rows)
explain (costs off) execute s1 using '1';
QUERY PLAN
-------------------------------------------------------------------
[Bypass]
Index Scan using test_type_table_a_varchar_idx on test_type_table
Index Cond: ((a_varchar)::text = $1)
(3 rows)
prepare s1 as select * from test_type_table where a_binary = ?;
explain (costs off) execute s1 using 1;
QUERY PLAN
------------------------------------------------------------------
[Bypass]
Index Scan using test_type_table_a_binary_idx on test_type_table
Index Cond: (a_binary = $1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
------------------------------------------------------------------
[Bypass]
Index Scan using test_type_table_a_binary_idx on test_type_table
Index Cond: (a_binary = $1)
(3 rows)
explain (costs off) execute s1 using '1';
QUERY PLAN
------------------------------------------------------------------
[Bypass]
Index Scan using test_type_table_a_binary_idx on test_type_table
Index Cond: (a_binary = $1)
(3 rows)
prepare s1 as select * from test_type_table where a_varbinary = ?;
explain (costs off) execute s1 using 1;
QUERY PLAN
---------------------------------------------------------------------
[Bypass]
Index Scan using test_type_table_a_varbinary_idx on test_type_table
Index Cond: (a_varbinary = $1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
---------------------------------------------------------------------
[Bypass]
Index Scan using test_type_table_a_varbinary_idx on test_type_table
Index Cond: (a_varbinary = $1)
(3 rows)
explain (costs off) execute s1 using '1';
QUERY PLAN
---------------------------------------------------------------------
[Bypass]
Index Scan using test_type_table_a_varbinary_idx on test_type_table
Index Cond: (a_varbinary = $1)
(3 rows)
prepare s1 as select * from test_type_table where a_tinyblob = ?;
explain (costs off) execute s1 using 1;
QUERY PLAN
--------------------------------------------------------------------
[Bypass]
Index Scan using test_type_table_a_tinyblob_idx on test_type_table
Index Cond: (a_tinyblob = $1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
--------------------------------------------------------------------
[Bypass]
Index Scan using test_type_table_a_tinyblob_idx on test_type_table
Index Cond: (a_tinyblob = $1)
(3 rows)
explain (costs off) execute s1 using '1';
QUERY PLAN
--------------------------------------------------------------------
[Bypass]
Index Scan using test_type_table_a_tinyblob_idx on test_type_table
Index Cond: (a_tinyblob = $1)
(3 rows)
prepare s1 as select * from test_type_table where a_blob = ?;
explain (costs off) execute s1 using 1;
ERROR: parameter $1 of type integer cannot be coerced to the expected type blob
HINT: You will need to rewrite or cast the expression.
explain (costs off) execute s1 using 1.23;
ERROR: parameter $1 of type numeric cannot be coerced to the expected type blob
HINT: You will need to rewrite or cast the expression.
explain (costs off) execute s1 using '1';
QUERY PLAN
----------------------------------------------------------------
[Bypass]
Index Scan using test_type_table_a_blob_idx on test_type_table
Index Cond: (a_blob = $1)
(3 rows)
prepare s1 as select * from test_type_table where a_longblob = ?;
explain (costs off) execute s1 using 1;
QUERY PLAN
--------------------------------------------------------------------
[Bypass]
Index Scan using test_type_table_a_longblob_idx on test_type_table
Index Cond: (a_longblob = $1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
--------------------------------------------------------------------
[Bypass]
Index Scan using test_type_table_a_longblob_idx on test_type_table
Index Cond: (a_longblob = $1)
(3 rows)
explain (costs off) execute s1 using '1';
QUERY PLAN
--------------------------------------------------------------------
[Bypass]
Index Scan using test_type_table_a_longblob_idx on test_type_table
Index Cond: (a_longblob = $1)
(3 rows)
prepare s1 as select * from test_type_table where a_text = ?;
explain (costs off) execute s1 using 1;
QUERY PLAN
----------------------------------------------------------------
[Bypass]
Index Scan using test_type_table_a_text_idx on test_type_table
Index Cond: (a_text = $1)
(3 rows)
explain (costs off) execute s1 using 1.23;
QUERY PLAN
----------------------------------------------------------------
[Bypass]
Index Scan using test_type_table_a_text_idx on test_type_table
Index Cond: (a_text = $1)
(3 rows)
explain (costs off) execute s1 using '1';
QUERY PLAN
----------------------------------------------------------------
[Bypass]
Index Scan using test_type_table_a_text_idx on test_type_table
Index Cond: (a_text = $1)
(3 rows)
drop table test_type_table;
set dolphin.transform_unknown_param_type_as_column_type_first = true;
set enable_beta_opfusion = on;
CREATE TABLE sbtest1 (id integer NOT NULL, k integer DEFAULT 0 NOT NULL, k1 int2 DEFAULT 0 NOT NULL, k2 float DEFAULT 0 NOT NULL, c character(120) DEFAULT ''::bpchar NOT NULL, pad character(60) DEFAULT ''::bpchar NOT NULL) WITH (orientation=row, compression=no);
insert into sbtest1 values (generate_series(1,100), generate_series(1,100), generate_series(1,100), generate_series(1,100), 'a', 'a');
CREATE INDEX k_1 ON sbtest1 USING btree (k) TABLESPACE pg_default;
CREATE INDEX k_2 ON sbtest1 USING btree (k1) TABLESPACE pg_default;
CREATE INDEX k_3 ON sbtest1 USING btree (k2) TABLESPACE pg_default;
ALTER TABLE sbtest1 ADD CONSTRAINT sbtest1_pkey PRIMARY KEY USING btree (id);
NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index "sbtest1_pkey" for table "sbtest1"
set opfusion_debug_mode = 'log';
prepare p3 as select sum(k) from sbtest1 where id between $1 and $2;
prepare p4 as select sum(k1) from sbtest1 where id between $1 and $2;
prepare p5 as select sum(k2) from sbtest1 where id between $1 and $2;
explain execute p3 (1, 100);
QUERY PLAN
----------------------------------------------------------------------------------
[Bypass]
Aggregate (cost=8.27..8.28 rows=1 width=36)
-> Index Scan using sbtest1_pkey on sbtest1 (cost=0.00..8.27 rows=1 width=4)
Index Cond: ((id >= $1) AND (id <= $2))
(4 rows)
execute p3 (1, 100);
sum
------
5050
(1 row)
explain execute p4 (1, 100);
QUERY PLAN
----------------------------------------------------------------------------------
[Bypass]
Aggregate (cost=8.27..8.28 rows=1 width=34)
-> Index Scan using sbtest1_pkey on sbtest1 (cost=0.00..8.27 rows=1 width=2)
Index Cond: ((id >= $1) AND (id <= $2))
(4 rows)
execute p4 (1, 100);
sum
------
5050
(1 row)
explain execute p5 (1, 100);
QUERY PLAN
----------------------------------------------------------------------------------
[Bypass]
Aggregate (cost=8.27..8.28 rows=1 width=12)
-> Index Scan using sbtest1_pkey on sbtest1 (cost=0.00..8.27 rows=1 width=4)
Index Cond: ((id >= $1) AND (id <= $2))
(4 rows)
execute p5 (1, 100);
sum
------
5050
(1 row)
drop table sbtest1;
drop schema prepare_index_con cascade;
NOTICE: drop cascades to table test1
reset current_schema;