Why has_useful_pathkeys() needs to check group_pathkeys - Mailing list pgsql-hackers

From Richard Guo
Subject Why has_useful_pathkeys() needs to check group_pathkeys
Date
Msg-id CAMbWs4_zW5QU=Zk32s17p8qWY+ga-3ZUTons+y+Wopguiopm4A@mail.gmail.com
Whole thread Raw
List pgsql-hackers
While reviewing the recent changes in truncate_useless_pathkeys(), I
noticed the nearby function has_useful_pathkeys(), and I'm a bit
confused.  It makes sense to check whether the given relation is
involved in joins or whether root->query_pathkeys is nonempty, but I
don't understand the need to specifically check root->group_pathkeys.

If the intention is to check whether there are useful pathkeys for
grouping, I think checking root->query_pathkeys is sufficient.  This
is because when group_pathkeys is nonempty, standard_qp_callback()
ensures that query_pathkeys is also nonempty.

'git log' shows that the check for root->group_pathkeys was introduced
in commit 0452b461b.  So cc'ing Alexander.

- Richard



pgsql-hackers by date:

Previous
From: Chao Li
Date:
Subject: Add downloaded files to gitignore
Next
From: vignesh C
Date:
Subject: Re: Logical Replication of sequences