Reduce "extract" cardinality with DISTINCT select#3203
Reduce "extract" cardinality with DISTINCT select#3203exo-cedric wants to merge 1 commit intopuppetlabs:6.xfrom
Conversation
|
Can one of the admins verify this patch? |
|
Waiting for CLA signature by @exo-cedric @exo-cedric - We require a Contributor License Agreement (CLA) for people who contribute to Puppet, but we have an easy click-through license with instructions, which is available at https://cla.puppet.com/ Note: if your contribution is trivial and you think it may be exempt from the CLA, please post a short reply to this comment with details. http://docs.puppet.com/community/trivial_patch_exemption.html |
According to https://puppet.com/community/trivial-patch-exemption-policy/ (mark corrected link), I believe this one-liner is trivial, as per: (Is it ?) |
We've been experiencing very bad PostreSQL performances lately, related to facts <-> node queries such as:
With correspdonding
EXPLAIN ANALYZEplan:By replacing all
SELECT r1.*clauses bySELECT DISTINCT r1.*, I have been able to significantly improve performances - almost two orders of magnitude - as shown by correspondingEXPLAIN ANALYZE:I have tracked this to the
compile-extractfunction, which I believe would benefit from the following single-liner PR.Does it make sense ?