On Fri, 2025-04-25 at 09:43 -0700, Bo Guo wrote:
> When creating a temporary table for additional sql operations in a stored function,
> should I worry about building indexes on the temp table to increase performance when
> the temp table's row count exceeds a certain threshold? If so, is there a rule of
> thumb for the row count threshold?
Well, if a table is small, you don't need an index. It is hard to say what is small.
For one, it depends on the size of the rows.
In general, I would say that it never pays to build an index on a temporary table
unless you are using that index at least twice.
Yours,
Laurenz Albe