futurewei-cloud / chogori-opengauss

Other
2 stars 7 forks source link

add support to push down predicates for seqscan #126

Closed johnfangAFW closed 1 year ago

johnfangAFW commented 1 year ago

examples:

create table usersq02(name varchar(20), address text, age int, PRIMARY KEY(name));

insert into usersq02 values('user01', 'location-A', 25); insert into usersq02 values('user02', 'location-B', 30); insert into usersq02 values('user03', 'location-A', 25); insert into usersq02 values('user04', 'location-A', 30);

openGauss=# select * from usersq02 where name = 'user01'; INFO: PgGate_ExecSelect for table usersq02: 00000000000030008000000000004911 with 1 constraints name | address | age --------+------------+----- user01 | location-A | 25 (1 row)

openGauss=# Select * from usersq02 where age = 25; INFO: PgGate_ExecSelect for table usersq02: 00000000000030008000000000004911 with 1 constraints name | address | age --------+------------+----- user01 | location-A | 25 user03 | location-A | 25 (2 rows)

openGauss=# select * from usersq02 where age = 30; INFO: PgGate_ExecSelect for table usersq02: 00000000000030008000000000004911 with 1 constraints name | address | age --------+------------+----- user02 | location-B | 30 (1 row)

openGauss=# select * from usersq02 where age < 30; INFO: PgGate_ExecSelect for table usersq02: 00000000000030008000000000004911 with 1 constraints name | address | age --------+------------+----- user01 | location-A | 25 user03 | location-A | 25 (2 rows)

openGauss=# Select * from usersq02 where age > 25; INFO: PgGate_ExecSelect for table usersq02: 00000000000030008000000000004911 with 1 constraints name | address | age --------+------------+----- user02 | location-B | 30 (1 row)

openGauss=# select * from usersq02 where age < 30; INFO: PgGate_ExecSelect for table usersq02: 00000000000030008000000000004911 with 1 constraints name | address | age --------+------------+----- user01 | location-A | 25 user03 | location-A | 25 (2 rows)

openGauss=# select * from usersq02 where age <= 30; INFO: PgGate_ExecSelect for table usersq02: 00000000000030008000000000004911 with 1 constraints name | address | age --------+------------+----- user01 | location-A | 25 user02 | location-B | 30 user03 | location-A | 25 user04 | location-A | 30 (4 rows)

openGauss=# Select * from usersq02 where age > 25; INFO: PgGate_ExecSelect for table usersq02: 00000000000030008000000000004911 with 1 constraints name | address | age --------+------------+----- user02 | location-B | 30 user04 | location-A | 30 (2 rows)

openGauss=# Select * from usersq02 where age >= 25; INFO: PgGate_ExecSelect for table usersq02: 00000000000030008000000000004911 with 1 constraints name | address | age --------+------------+----- user01 | location-A | 25 user02 | location-B | 30 user03 | location-A | 25 user04 | location-A | 30 (4 rows)