Skip to content

Fix incorrect join condition. We want to join all columns of the inde… #15

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

derkv-github
Copy link

…x, no matter the column order in the table

The query selects the average length for all columns in the index. At the moment the columns from the index are selected as
regexp_split_to_table(indkey::text, ' ')::smallint, which provides the column numbers from the columns with respect to the table. For example column 10 and column 11.

When joining with the table pg_attribute this gives a problem since this table contains the column numbers with respect to the order within the index. For a index on two columns this would be 1 and 2. Since the orders in the two tables differs, we can't use this as a join condition.

Since we want to select the average columns width for all columns in the index we can just join all the columns from pg_attribute.

…x, no matter the column order in the table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants