I am not an expert on this, But I would like to take a shot :)
Is it possible to share your prepared statement and parameter types.
I mean
something like this
PREPARE usrrptplan (int) AS SELECT * FROM users u, logs l WHERE u.usrid=$1 AND u.usrid=l.usrid AND l.date = $2;
EXECUTE usrrptplan(1, current_date);
It's just that sometimes the datatypes of the prepared statement params are not the same as the datatype of the field in the join and as a result it may add some overhead.
On Tue, 2021-05-04 at 13:59 +0000, Alex wrote: > "Powerful general purpose relational database" but not smart...
Too smart can easily become slow...
> I propose a feature to use information from previously executed queries to adjust the query plan time accordingly. > Reusing the same generic plan may and will lead to very long execution times.
AI can go wrong too, and I personally would be worried that such cases are very hard to debug...