huge query tree cost too much time to copyObject()

Поиск
Список
Период
Сортировка
От Tao Ma
Тема huge query tree cost too much time to copyObject()
Дата
Msg-id ggdmp3$2i0a$1@news.hub.org
обсуждение исходный текст
Ответы Re: huge query tree cost too much time to copyObject()  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,

recently, I wrote a really complex SELECT statement which consists of about 
20 relations using NATURAL JOIN method and every single relation consists 50 
columns. It looks like:
PREPARE ugly_stmt AS
SELECT * FROM t1 NATURAL JOIN t2 NATURAL JOIN t3 ... NATURAL JOIN t20 WHERE 
id = $1;

All tables share only one common column "id" which is also defined as primay 
key.

I set join_collapse_limit to 1 and just write a prepare statement for 
calling multi-times.
It seems Postgres cost lots of time to copyObject(). So can I just allocate 
a new context from TopMemoryContext before doing QueryRewrite() and 
pg_plan_queries(), and save them into hash table without copying query_list 
and plan_list again(i think they are lived in the context I created). I know 
I am subjected a long term memory leak until I deallocate the prepared 
statement, but it save lots of time in my situation. And I can bear with 
it...

Thanks in advance 




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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: TODO item: adding VERBOSE option to CLUSTER [with patch]
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: WIP: default values for function parameters