No.
A query with a CTE creates an internal, temporary representation of a table that is visible exclusively to the query itself.
I don't see a way to use a TEMPORARY
table in multiple threads either, since temporary tables are only visible within the same session.
The next best thing would be an UNLOGGED
table. Still cheaper than a regular table, but not quite as cheap as either of the above.
Unlike with a CTE, you can create indexes and ANALYZE
TEMPORARY
or UNLOGGED
tables, though - which may help a lot with huge cardinalities but not with your example (LIMIT 1
).