Comment 19 for bug 1768022

Revision history for this message
Jason Boyer (jboyer) wrote :

So, uh, interesting finding here. I pulled out each join one at a time and nothing would budge the planning time until I took out ausp and it dropped to > 100ms. Not wanting to remove it entirely I looked at the ON clause and on a whim swapped ahr.usr = ausp.usr for au.id = ausp.usr and that's all it takes. Is this whole thing built by the fielder or is this something else that could be gently nudged to make all of our web client users extremely happy?

I have no idea why that particular way of making that join freaks postgres out but it doesn't seem like something I can alter settings to fix. (vacuum analyze-ing tables all over doesn't make any difference.)

Same query, same results, one line change, super fast plan: https://pastebin.com/GYmwVZ1U