Re: Large CASE-statement is pretty slow?
| От | Tom Lane |
|---|---|
| Тема | Re: Large CASE-statement is pretty slow? |
| Дата | |
| Msg-id | 25013.1079298580@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Large CASE-statement is pretty slow? (Arjen van der Meijden <acmmailing@vulcanus.its.tudelft.nl>) |
| Ответы |
Re: Large CASE-statement is pretty slow?
|
| Список | pgsql-performance |
Arjen van der Meijden <acmmailing@vulcanus.its.tudelft.nl> writes:
> Anyway, I was looking into the usefullness of a INSERT INTO newtable
> SELECT field, field, CASE pkey WHEN x1 THEN y1 WHEN x2 THEN y2 etc END
> FROM oldtable
> The resulting select was about 1.7MB of query-text, mostly composed of
> the CASE-statement.
Hm, you mean one single SELECT, one single CASE? How many WHEN clauses
exactly? Exactly what did a typical clause of the CASE look like?
I wouldn't be too surprised to find some bit of code that's O(N^2) in
the number of arms of the CASE, or something like that; it's not an area
that we've ever felt the need to optimize. But I'd like a fairly
specific test case before trying to look into it.
regards, tom lane
В списке pgsql-performance по дате отправления: