We are on Postgres 15.5 (Aurora) and capturing query plans via auto_explain. We are seeing a large number of query plans for 2 queries that have 12 tables. Every fast (or "fast enough") plan has a left deep tree and every slow plan has a bushy tree. Is there a way to determine if a plan was generated by GECO?
We have from_collapse_limit, join_collapse_limit and geqo_threshold all set to 12. (There is a COUNT(*) above derived table - could that be somehow affecting this?) I've manually explained plans and haven't seen the problem, but then it turns up the next day (with the same parameter values) with multiple execution plans. One more data point - each of the individual query plans is executed in a distinct time range (during the customer's test). (No environment changes between these time ranges.) The only overlap was with one of the queries where a single execution of a generic plan occurred during the time range that a different plan was being executed. (The generic plan was the fastest plan out of all of the plans.)