Skip to content

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