avamingli opened a new issue, #1248:
URL: https://github.com/apache/cloudberry/issues/1248
### Apache Cloudberry version
_No response_
### What happened
optimizer_enable_indexscan doesn't take affect
### What you think should happen instead
The GUC parameter exists in the codebase but has no active references.
### How to reproduce
```sql
create table t(a int, b int);
insert into t select 1, i from generate_series(1, 10000)i;
insert into t select i, i from generate_series(10000, 20000)i;
create index on t(a, b);
analyze t;
```
```sql
explain select * from t where a = 1 and b > 1 order by a, b;
QUERY PLAN
---------------------------------------------------------------------------------
Gather Motion 1:1 (slice1; segments: 1) (cost=0.00..7.75 rows=8948
width=8)
Merge Key: a, b
-> Index Only Scan using t_a_b_idx on t (cost=0.00..7.44 rows=2983
width=8)
Index Cond: ((a = 1) AND (b > 1))
Optimizer: GPORCA
(5 rows)
gpadmin=# set optimizer_enable_indexscan = off;
SET
gpadmin=# explain select * from t where a = 1 and b > 1 order by a, b;
QUERY PLAN
---------------------------------------------------------------------------------
Gather Motion 1:1 (slice1; segments: 1) (cost=0.00..7.75 rows=8948
width=8)
Merge Key: a, b
-> Index Only Scan using t_a_b_idx on t (cost=0.00..7.44 rows=2983
width=8)
Index Cond: ((a = 1) AND (b > 1))
Optimizer: GPORCA
(5 rows)
```
### Operating System
all
### Anything else
_No response_
### Are you willing to submit PR?
- [ ] Yes, I am willing to submit a PR!
### Code of Conduct
- [x] I agree to follow this project's [Code of
Conduct](https://github.com/apache/cloudberry/blob/main/CODE_OF_CONDUCT.md).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]