Re: [HACKERS] type cache for concat functions
От | Alexander Kuzmenkov |
---|---|
Тема | Re: [HACKERS] type cache for concat functions |
Дата | |
Msg-id | 748b7a45-b1b0-7a8d-719f-4d42a1645d50@postgrespro.ru обсуждение исходный текст |
Ответ на | [HACKERS] type cache for concat functions (Pavel Stehule <pavel.stehule@gmail.com>) |
Ответы |
Re: [HACKERS] type cache for concat functions
|
Список | pgsql-hackers |
Hi Pavel, I tried applying your patch, it applies and compiles fine, check and checkworld pass. I ran a simple performance test, select concat(generate_series(1,100000), ... [x5 total]) vs select generate_series(1,100000)::text || ... . Operator || runs in 60 ms, while unpatched concat takes 90 and patched -- 55 ms. About the code: * There seems to be an extra tab here: FmgrInfo *typcache; It's not aligned with the previous declaration with tab size 4. * You could allocate the cache and store it into the context inside rebuildConcatCache. It would return return the cache pointer, and the calling code would look cleaner -- just one line. This is a matter of taste though. * The nearby functions use snake_case, so it should be rebuild_concat_cache too. Overall the patch looks good to me. -- Alexander Kuzmenkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company
В списке pgsql-hackers по дате отправления: