Re: When indexing is needed for a temp table

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: When indexing is needed for a temp table
Дата
Msg-id 00aaff3a04b0704940d48d29e38705d21512a12d.camel@cybertec.at
обсуждение исходный текст
Ответ на When indexing is needed for a temp table  (Bo Guo <bo.guo@gisticinc.com>)
Список pgsql-admin
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



В списке pgsql-admin по дате отправления: