Re: ECPG FETCH readahead
От | Boszormenyi Zoltan |
---|---|
Тема | Re: ECPG FETCH readahead |
Дата | |
Msg-id | 4F6D9893.3030300@cybertec.at обсуждение исходный текст |
Ответ на | Re: ECPG FETCH readahead (Robert Haas <robertmhaas@gmail.com>) |
Ответы |
Re: ECPG FETCH readahead
|
Список | pgsql-hackers |
2012-03-15 21:59 keltezéssel, Robert Haas írta: > I think we need either an updated version of this patch that's ready for commit real > soon now, or we need to postpone it to 9.3. Sorry for the delay, I had been busy with other tasks and I rewrote this code to better cope with unknown result size, scrollable cursors and negative cursor positions. I think all points raised by Noah is addressed: per-cursor readahead window size, extensive comments, documentation and not enabling result set size discovery. Also, I noticed this in passing: static void free_variable(struct variable * var) { struct variable *var_next; if (var == NULL) return; var_next = var->next; ecpg_free(var); while (var_next) { var = var_next; var_next = var->next; ecpg_free(var); } } I rewrote this as below to eliminate manual unrolling of the loop, they are equivalent: static void free_variable(struct variable * var) { struct variable *var_next; while (var) { var_next = var->next; ecpg_free(var); var = var_next; } } The problem with WHERE CURRENT OF is solved by a little more grammar and ecpglib code, which effectively does a MOVE ABSOLUTE N before executing the DML with WHERE CURRENT OF clause. No patching of the backend. This way, the new ECPG caching code is compatible with older servers but obviously reduces the efficiency of caching. Attached are two patches, the first one is the feature patch. The second patch makes all cursor statements go through the new caching functions with 1 tuple readahead window size. It only changes the preprocessed code and stderr logs of the regression tests affected, not their results. Best regards, Zoltán Böszörményi -- ---------------------------------- Zoltán Böszörményi Cybertec Schönig& Schönig GmbH Gröhrmühlgasse 26 A-2700 Wiener Neustadt, Austria Web: http://www.postgresql-support.de http://www.postgresql.at/
Вложения
В списке pgsql-hackers по дате отправления: