HuSen8891 opened a new issue, #1031:
URL: https://github.com/apache/cloudberry/issues/1031
### Apache Cloudberry version
_No response_
### What happened
postgres=# set optimizer to on;
SET
postgres=# explain select * from test for update;
QUERY PLAN
------------------------------------------------------------------------------
Gather Motion 2:1 (slice1; segments: 2) (cost=0.00..431.00 rows=1 width=4)
-> Seq Scan on test (cost=0.00..431.00 rows=1 width=4)
Optimizer: GPORCA
(3 rows)
postgres=# set optimizer to off;
SET
postgres=# explain select * from test for update;
QUERY PLAN
------------------------------------------------------------------------------------
Gather Motion 2:1 (slice1; segments: 2) (cost=0.00..2457.50 rows=96300
width=10)
-> LockRows (cost=0.00..1013.00 rows=48150 width=10)
-> Seq Scan on test (cost=0.00..531.50 rows=48150 width=10)
Optimizer: Postgres query optimizer
(4 rows)
when set optimizer to on, plan for select-for-update statement is not
correct because LockRows is lacked.
### What you think should happen instead
_No response_
### How to reproduce
set optimizer to on;
explain select * from test for update;
### Operating System
centos
### 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]