TO_CHAR SO SLOW???
От | Maksim Likharev |
---|---|
Тема | TO_CHAR SO SLOW??? |
Дата | |
Msg-id | 56510AAEF435D240958D1CE8C6B1770A016D2D5B@mailc03.aurigin.com обсуждение исходный текст |
Ответы |
Re: TO_CHAR SO SLOW???
|
Список | pgsql-hackers |
Hi, I have some SQL function, just regular function selects data by using 4 joins nothing fancy, but one thing pretty noticeable, I have to display 3 different columns with same date formatted differently, here are 3 different snippets: 1. SELECT t.x,t.y,TO_CHAR(t.dt, 'DD/MM/YYYY') FROM ( SELECT x, y, dt FROM .... ) AS t ... 2. SELECT t.x,t.y,TO_CHAR(t.dt, 'DD/MM/YYYY'), TO_CHAR(t.dt, 'Mon-YYYY')FROM ( SELECT x, y, dt FROM .... ) AS t.. 3. SELECT t.x,t.y,TO_CHAR(t.dt, 'DD/MM/YYYY'), TO_CHAR(t.dt, 'Mon-YYYY'), TO_CHAR(t.dt, 'YYYY')FROM ( SELECT x, y, dt FROM .... ) AS t ... # 1: 15000 rows, I getting data for 130 sec # 2: 15000 rows, I getting data for 160 sec # 3: 15000 rows, I getting data for 220 sec adding different fields into output change query time only marginally but adding or removing to_char, just heavily knocks performance. is it TO_CHAR so slow?? P.S Postgres 7.3
В списке pgsql-hackers по дате отправления: