Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] reltuples in pg_class may be wrong for index #214

Closed
1 of 2 tasks
shmiwy opened this issue Sep 21, 2023 · 0 comments · Fixed by #217
Closed
1 of 2 tasks

[Bug] reltuples in pg_class may be wrong for index #214

shmiwy opened this issue Sep 21, 2023 · 0 comments · Fixed by #217
Labels
type: Bug Something isn't working

Comments

@shmiwy
Copy link

shmiwy commented Sep 21, 2023

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) DISTRIBUTED BY (a);
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, 10) AS i;

SET optimizer=off;

VACUUM foo;
DELETE FROM foo WHERE a < 4;
SELECT relname, reltuples FROM pg_class WHERE relname = 'foo_index';

the result for the query is

  relname  | reltuples
-----------+-----------
 foo_index |         0
(1 row)

It seems wrong.

What you think should happen instead

The result of reltuples probably shouldn't be 0

How to reproduce

rerun the query.

Operating System

centos7

Anything else

No response

Are you willing to submit PR?

  • Yes, I am willing to submit a PR!

Code of Conduct

@shmiwy shmiwy added the type: Bug Something isn't working label Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant