Cloudberry Database version
No response
What happened
SET gp_create_table_random_default_distribution=off;
DROP TABLE IF EXISTS foo;
CREATE TABLE foo (a INT, b INT, c CHAR(128)) WITH (appendonly=true);
CREATE INDEX foo_index ON foo(b);
INSERT INTO foo SELECT i as a, 1 as b, 'hello world' as c FROM generate_series(1, 100) AS i;
SET optimizer=off;
VACUUM foo;
DELETE FROM foo WHERE a < 4;
SELECT COUNT(*) FROM foo;
SELECT count(*) FROM pg_class WHERE relname='foo';
SELECT segno, tupcount, state FROM gp_aoseg_name('foo');
VACUUM full foo;
SELECT segno, tupcount, state FROM gp_aoseg_name('foo');
DELETE FROM foo WHERE a < 12;
SELECT segno, tupcount, state FROM gp_aoseg_name('foo');
drop function gp_aoseg_name;
sql with gp_aoseg_name appears to return some useless rows (tupcount = 0)
gpadmin=# SELECT COUNT(*) FROM foo;
count
-------
97
(1 row)
gpadmin=#
gpadmin=# SELECT count(*) FROM pg_class WHERE relname='foo';
count
-------
1
(1 row)
gpadmin=#
gpadmin=# SELECT segno, tupcount, state FROM gp_aoseg_name('foo');
segno | tupcount | state
-------+----------+-------
1 | 100 | 1
2 | 0 | 1
3 | 0 | 1
4 | 0 | 1
(4 rows)
gpadmin=# VACUUM full foo;
VACUUM
gpadmin=# SELECT segno, tupcount, state FROM gp_aoseg_name('foo');
segno | tupcount | state
-------+----------+-------
1 | 25 | 1
2 | 72 | 1
3 | 0 | 1
4 | 0 | 1
(4 rows)
gpadmin=# DELETE FROM foo WHERE a < 12;
DELETE 8
gpadmin=# SELECT segno, tupcount, state FROM gp_aoseg_name('foo');
segno | tupcount | state
-------+----------+-------
1 | 25 | 1
2 | 72 | 1
3 | 0 | 1
4 | 0 | 1
(4 rows)
What you think should happen instead
There should be no rows with tupcount=0
How to reproduce
rerun the sql.
Operating System
centos7
Anything else
No response
Are you willing to submit PR?
Code of Conduct
Cloudberry Database version
No response
What happened
sql with
gp_aoseg_nameappears to return some useless rows (tupcount = 0)What you think should happen instead
There should be no rows with
tupcount=0How to reproduce
rerun the sql.
Operating System
centos7
Anything else
No response
Are you willing to submit PR?
Code of Conduct