On Fri, Jan 15, 2021 at 3:27 PM Alexander Stoddard < alexander.stodd...@gmail.com> wrote:
> The queries are complex, multiple joins to 10 plus tables, although most > are to tiny enum type lookup tables. I believe it is the join between the > two large tables that I have described that causes the issue, and that > seems to be reflected in the different strategies in the plans. For my own > learning and to clarify the problem I probably will have to try and > reproduce the behavior in a test case. > ... > I am doing nothing to specify the optimizer. Do I have configurable > options in that regard? I was unaware of them. > Read up on join_collapse_limit and geqo. https://www.postgresql.org/docs/current/runtime-config-query.html Note that you can set these values within your session to check and even just run explain [query] to check if the plan that would be used varies.