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] pg_relation_size may get wrong result. #213

Closed
1 of 2 tasks
shmiwy opened this issue Sep 21, 2023 · 1 comment
Closed
1 of 2 tasks

[Bug] pg_relation_size may get wrong result. #213

shmiwy opened this issue Sep 21, 2023 · 1 comment
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;
create or replace function junkloop(rel text, numiter int) returns int as $$
declare
  sql text;
begin
  for i in 0..numiter loop
    sql := $sql$ insert into $sql$ || rel || $sql$ select 1, $sql$ || i::text || $sql$, repeat('x', 1000) $sql$;
    execute sql;
  end loop;
  return numiter;
end;
$$ language plpgsql;

drop table if exists vfao;
create table vfao (a, b, c) with (appendonly=true, orientation=column) as
select 1, i, repeat('x', 1000) from generate_series(1, 100)i distributed by (a);
create index ivfao on vfao(b, c);

select junkloop('vfao', 300);
select pg_relation_size((select segrelid from pg_appendonly where relid = 'vfao'::regclass)) from gp_dist_random('gp_id') where gp_segment_id = 1;

the result for now is

 pg_relation_size
------------------
           163840

It looks like this value is too large.

What you think should happen instead

No response

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
@github-actions
Copy link

Hey, @shmiwy welcome!🎊 Thanks for taking the time to point this out.🙌

@shmiwy shmiwy closed this as completed 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

No branches or pull requests

1 participant