Prepared Statement Question

Поиск
Список
Период
Сортировка
От Strong, David
Тема Prepared Statement Question
Дата
Msg-id B6419AF36AC8524082E1BC17DA2506E802579E42@USMV-EXCH2.na.uis.unisys.com
обсуждение исходный текст
Ответ на Interface of the R-tree in order to work with postgresql  ("jorge alberto" <jorge.is.a.geek@gmail.com>)
Ответы Re: Prepared Statement Question  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
We have a question regarding prepared statements. The following code is located in src/backend/tcop/postgres.c:   /*
Getthe parameter format codes */   numPFormats = pq_getmsgint(input_message, 2);   if (numPFormats > 0)   {       int
i;      pformats = (int16 *) palloc(numPFormats * sizeof(int16));       for (i = 0; i < numPFormats; i++)
pformats[i]= pq_getmsgint(input_message, 2);   } 

There is similar code for Parameter Lists (ParamListInfo) and Result Format Codes (rformats). Unless we're missing
something,a prepared statement would probably never change once prepared.  
Would there be any issue or benefit moving the allocation of these buffers to the PreparedStatement structure so they
staywith the prepared statement throughout its life? There is probably the question of named versus unnamed prepared
statements,but is there anything else that we might be missing? 
Along these lines, would it also be possible to keep an Executor State and Expression Context with the statement and
justreset key parts of them, rather than rebuilding them from scratch each time a prepared statement is executed? 
Thanks
David


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: 8.2beta1 crash possibly in libpq
Следующее
От: Mark Cave-Ayland
Дата:
Сообщение: Re: 8.2beta1 crash possibly in libpq