3 ms·
The CTE in the final query seems like it should be replaced with a subquery (or view?) because the CTE is an optimisation fence, so it's going to seq scan email
by bruce_one 9y ago
The CTE in the final query seems like it should be replaced with a subquery (or view?) because the CTE is an optimisation fence, so it's going to seq scan email every time, even if there's a where condition which could use the message_id index.