updated qCache

Started by Neil Conwayover 23 years ago9 messages
#1Neil Conway
nconway@klamath.dyndns.org
1 attachment(s)

Hi all,

Here's an updated version of the experimental qCache patch I
posted a couple days ago (which is a port of Karel Zak's 7.0
work to CVS HEAD).

Changes:

- fix segfault in EXECUTE under some circumstances (reported
by Barry Lind)
- fix some memory leaks (thanks to Karel Zak)
- write more regression tests (make check still won't pass)
- re-diff against CVS HEAD
- more code cleanup, minor tweaks

However, I've tentatively decided that I think the best
way to go forward is to rewrite this code. IMHO the utility of
plans cached in shared memory is fairly limited, but the
code that implements this adds a lot of complex to the patch.
I'm planning to re-implement PREPARE/EXECUTE with support only
for locally-prepared plans, using the existing patch as a
guide. The result should be a simpler patch -- once it's
in CVS we can worry about more advanced plan caching
techiques. Any complaints/comments on this plan?

Cheers,

Neil

--
Neil Conway <neilconway@rogers.com>
PGP Key ID: DB3C29FC

Attachments:

qcache-2.patch.gzapplication/octet-stream; name=qcache-2.patch.gzDownload
�X��<qcache-2.patch�\mw���������MHG������������ZJ��v�MA2O(R&)�4��3�)Jvn�{�*�E���}���>$���p�O"7/�(M����W
��W_����;���}h^�q3�/��u��O�����j���"�}q��S��+����vg���?�@��z��`}kk��	Z�������ju��r����~�~,�E�^��8�+2��~�����$C�0?<��Nm��-����-���w���n�{������E F�7��z��jn�PA�7I!����cl����	�j�g�������!��Ey��W]��P���������6<��?q��8��@�n��	�����Us�F[��Mx��(��<p��$�<�Mq�7~z	)Az7
�������`���FB��OGT���XP�F%/;;{�r�X������?���x���%
$��$p����H�yj����������������h~���8�A�w��g�&���4�?������6���^��e<�?zD����=�����S���6�|�,�t o<7����}U6i7
'��tN�ko&�n,����d"�d�8xu
�~���N����a�\�F��?}tPj������}��}����!g�4�mI�9��XL�E���.w*l�y�l��h6s�q�|�~d����n������W0t�=�F\6rKD��nn�Z����~k;3pH�l�*(|�mko�:-��~�����mh?���aF�� �pi�N��c@�<��b�J���I#7t��?]%w���H7A�DW8b�|5���?H��z&����������dz$��n����$p�2���.V��Mr�o���p�$P����
q��G�W�q��S:8��_��\��b1�;y����4t���FD���W�����&�����b��?���l����Pt&�D��j�����n�� ������-h���G��J����R���w�vm��#��QJ�[}���l�t�����	w,�%�<R(���^��pN����=�vM����D������~���������z�s�>�NB#�>C�E�O����x�������%)�������h	8;������_{����"E�J��~�i����)6[���s�L��m9����iK�9�3H���"�Eu��M�d��8E������w�E8��O�����h��bm4EI���OF�K�0������h��P��+����j,�J�<7�����~�u��~�"�sK���c�s��^�=���6�����J����=kG�R�Cgm�z] ��3�@YA3�D����,\�l4�t��?�Fo?������I.8,/���FG�(qc2G�&��I��#V<���?B��T�!�"H�2).	�6����R���R.q	����������#�x�u�/k�`m���H0�-4�E�Yl�g���jn���v�	�o����AJF�(��w�%U�AA)w��X=��RS�.����b�w�S��q�^�����i��
�����lU�i(B�����I��])����	
O�H-E�
X�����W�������9Kk���O{$)��g��3d��E,b���ORy;
��O���(a���\\�^H���<�6QX���-9�y_|'5����;�/})3�h��������M-VY&���^
���lUX��*-Wo��&`'�������[����D��h�������C����\I��g��:���m�
+��G���C�fK��?8%��Q<4Z��k�_��iH��W����h�ax|r<���|*���StA7?�=E��`l����0bE� ���A���0d����Ri����@(<�$n|'���v*��y���bT���!6�aAk�#I��a\(�X3��(���A�B=�(
� B��#x�o[\cO-�RVM���SO��E��JR����=,�����*k����8�Vk�JS05��P���C�\gq��z�@0��$������_8���aV)�ds��O����&�����8W
�"$�E��)�H5�
���7��(�E���rN�F�l=�������Jo9�|N�i�w>������������g����[{x~����N���b�}����y����b���h,���c�������k;�}D��2�yr�v6�+�1Oi`���@�\���"���O,���w�)^�u�K������F����
��L8�6�d��Q�������^�c16�"�n���������Tx������	�HG�����k@%5@�����'�o���	r�*e�d���Ke��r8�����)n�8��pK3�c	^Q4TP�*�>CC�D��JP�c� G�dLJ��$r�Jo'q4�o
>�RRr
E�\QRh��.s4�K"���DL������V���}W�x�U�j�������BY���I�M������=
D6�� �<8:y��eX�R^�?��h8*��2j)D�����?'�5��c�wlI�6�4�,�1�JH�#�2hj�U��@��3%
mB5�F���������N&�E��~/���~�EZ��,V���������j3�Z��8�O�`d�/z��{� e��)�������SrW"������9V��
���*Lm��G�U��N�2S�X+��$�O����2��\�*���"x��Vb�.�L����hdt)	��le��
z���v`��9��Z,�$������*1����U��F7��=�zUU�-�%��ae6�g������.��.I�m��A��q%��I��_NNW�@��"A	T��g%�v��qb�}�8��"t��8��N�52~A�\�����gT�
���<�K\c��Ut���#����������u|��g*K�'��IV��=�W������������#�@����S�
�5���
_���������re��b��rtf�i1���
���C���I�@#0�!����	�+��������y��s5	('d��w?
EQL�2�w��d��u�^������0���|G��=���h�����at�����_e�.����#���[�jN�q���)�����/�Y��b
��"��+�M�WR�����Q�9�kie��G��	0������P%��I�;TfHs�����UN8<%�O9����WP�-zZ��7
d��{��S����y��.��i��3�������'\j����~N�����X$+�D�q��p�&������������e,�@B�&?��������"x_`=��d��E,$�'�2��$������),����^��4j,sY
������9&�%������yZ-C�-P
���e�G/�*����G�7]7�������������
���V21P%�9G��:�i(D4`7^=�2��a���*���(��������};��c��������c���I�*99�����(���C��f�n�`���l������X��q��!�
�����RZ��<n����x���l)�C�_�kd���e��s���h�9���g��#�����p��0 ��^��J���!��X��k�]������������t�����!kbl��C#ja)ki��'\m�@m�gV���y,.��@>d�&����s�r�Z�c���D��y2�	J��-m����EP��7��q�;_OEVYK�;��R�U�R�pvt�Y��J��glR�k�?c8Y��{4��TN)���'z�W9\
��*�T�����8�H��{����-3�RXb�~T��S_G����Q3MY�|.u��3��Xx��u����k75�o��M�h �(JM���vmL���"F/���$�nz�=�����eV_��J������c��*K��������LeU6��%2)*��YCi�T��6i����?�����.����O�7m�|�u���p!���;uGo��>���T`)�r���l�H��C��u���H���d]����A
���%�<�������FeV�U��6#���s���`�O'�o����P���YV��,�`8�g��s�-i���$WV�>�AT�U!K&`"a�����*S;�������94��&?�<(�uKUh.�����SE�=����,�*����WD�}���~���1��%��������r�w�\i�YN�,7��T�N���5��������He�>F�����D9�5���\(����.1����qJ0�,P|�;��^�h.�Ob,c�Us�n���
�;��==�##"�?�{l�2��Y���/f�^����}]�l�T���3$AGg���l��xL�(q��
���rg*���J���R�X��K�RG��$�M�N5�w���:�^�D�9h�$Q<�0�}�	�*��|��L������<��+�|&x _Y1WU�W������'$�@�JH*��� H5�#W��F��qnF�J�c�&	��I��]�yY��D���|��9�v��6_�io��[��?j�)#�>{���V����7>��0�>��/��dL��Gd��h$}uF�����>���>���pD��H1�g��C��6�s2_A[�M��9�4;��������� ����z�m�C��
U���x��*0�Q#v4t1@���
��#[����h��B�_��K�o����lv�:�@�DqddU	��N�A���rV�vh+;]�!Sd�C]�n7��m5u��Yy�P~eJ����R�3��HGuIM���"��u�8<Kd����������te6���R9��x��U#�{����Jo��V�4�0�58�#ez������Rs��,�e�>[�J8�t]�u�
��+�*m����il3�+\9�l��R(��F��������5��r�X���������B��t������R���C:g}0���F�u�X��G!h�UJB����e��=��:�!�P����|T�@���4j4�NP8)R�F@U��_���J���yy����F��,��*�-�a"	�+�'��'�h�LC��:��.'��a��/����"��]��E���/W����1�Q��q��^^�:pg�����^�^��PRc(����L��$��i�I��������:�U���j���]R�Q��y�����[�l&�r`�2�^�.b��.N�c���b]�6���s/��4W6n��Hg�o��J��E����L�4��� ]���M�(.�
������q�k����l�$��?���Y��T�W�����1�"+mv�ZY��riv��%U`gz��EI������S)���7����z��e��M��:h��U��a�.�at�1�0���P�HJ9;���NG�*(0��V	�v�w�/j�{�����"�M%��~������b&Y�!�]�PI{k�N���W����`�����z@�f=��6�l3���8���d���j�6kU�}�z��\�3w�'�#C�~�Y26=��u�h)�R�(��6>�h^�����j�m�]������T�%���,�P�*�;�����qIQ0�k-��<�������W)�2�M���_�_s���
2�wxz��o&q������J�LS�]�xr�	G>���OXm���a��*L�/���@d��Hv�:��3�T�Z�L�	w����d���vw�%�-�j�a�Z����^�o��2��#�������Q*E	{���N�_-y,t~jD��<JMd��"!�l 
�����P��T���l"�:/��M#J�HIb'NyL���6=�z�<1�"�����t��x���J���b������&�N�!����)*b�"����������3���
S���lM���/������O�{��g{o����,�}�O�bld$�Q��a	����"P&��<��\# d[O�������������*��tWo��U����G����i�}v��{��
�4NZ��>���\	"���U�s��U��I��K�B�2O@�NQa�.#@� �����j
Vb���^�Y��3~��g��Bv����J;E�_�xG��eX4g���(�;�&�*Gr~��aw���o"g�Du��8������3��7��MA��9�R:)����8<d�\8^��a�"���^i' U��LH�9��-w��6N�q��F�Vdl������������]A$uU0LA��q�z�taO�m}#7S�/��MQ�"� X�d���M��J����'C�;O���hE�`�7IF�7�����O�������@�:���e|�C��z�s�����F����Y������~8���"�r���j��B���N��$�%����7�ME����j]^�U5V`f���+�FI��\*�$/��Z��	}���_��i+�Y�TMV���vv��������-v�`G�(�b���f� 0���������;����J�V��y��CLjI=�M�0V��Ft%�]Zb*�4�#�M�e��� ��C����k��C����9`MK8VUQ�������Ex���~��$m��-U�����X��+�c����z��+�����;���\�t�o�b���*�{0�	pF�d*UN����W,om����=sg���R�53��A*G���I?�M�}]��y�q�@Z�CS��h�6�R��V��j"J������bI�7+u�Fu�<R_��EDQ�$ ��X�f��LsT��X'Y~��=��;i��z>6:�1�2a�B��@ ~@�~dm�)f���Qj_�=�����m0��G�3S�7,bi���
����K���f��Pj�Z�*��eRYx����N�~�O#�F�>���E5�N-������}��t��]B,U�������FND�/�3�W�3���_���{��
��<G���D����bygwK�OVg�eP�W�Z���cU&����2Y��>Nk}�\Ik=Sc���,.�e��W�d�j�m=Z����[��-gG"��#�o)���i�/�,����e|Y�*U�k�!�J�{���?�[�l9Q�w�[&86EQ�iJ�}Rg����\Z�K^�Rz|y�h�G�U�x���!Y	tceG�D.">�00`���QQ�*���;!_C��>��;��:�g�
�wD��~�4�;��S��`��b?���z���Q�Y�Dz/8JWsB^iG��'��	�!����<���u�z�1�0d��s�8��s��O�Jy��1���QO�m�e���`��<bRG� o��l����q!yh�52?��r����b�H'q��:=����f��$��>6^;f�������+yYT "w������h�	7�� .��������-�����9��*�V������;����X�l��ttz�a��<w�$��N(���KO�)?��$�J��g�S���d��;�6/�[��R7L�B
8�b8I����
���~������-����T�]�,�K�\��L���b��:4`�
W���Y�ZD���E�	$#[�8\�A
���?(uH����zs�;�7w���@{6-��J�\66�����K���/&��?A�'J[A�7�U�-����&D��vx�K�$��
j��~9>��n�����>����1�\ot��/�.�(!b��h{\?�����Q����� �i=���,�\�fI�>g �)�wT����\TE���@XY���������`:\�BL������$^ �!��3��q��{b�i���������M������3��@�+1�;	�F�1)X3��k�;����P�����1�?�q}��{��0�������:5�}m@=���AJ����4��5X"���A��/�}-�aM.3�����t�6�l+*�)����zmZ�(�~��T��R����j,W����JsI!	����M\��.��?9#7��;8��7Qt��a�3���e��5/b1��L����d����8VQ���S����yg"�D���#����6�"Y(�wD$!K������!���5I�G�K�Z���,+{����^q�TN���!T��Lo6FM��l!	4c��R���/?�D�G��Q����5g3[s��i���3[S~���4�s�w�f���/���>�@��+�����,V���9���A���B����!��K�YH�tb����"�|�4�2��	�V���m_��7�z�����������g�P�s��� .�*�NDi��SZ�0�<hk<Q������D��=c���XS��O&�Z�5
��*RG��Q�n"�'j�{����0�h�	d|h��~�Ls8k���W�P�
B8���C'1�n��'�O�A^�P�*�~(gmR���a�8�3�kz97P���IG0:Q�\����������XDc�6��U����%>�����n������|n4>J�pZe�����c�h���|8����dY0�.�}�NZ"���X\7
��[��u�+��d,����~�(�K�S)��"��<��E3���J�h�	NVA7��ao��5���&j�"b��-b���tbj�����!�m�$ec�>*,d�L�5?��<�sa��`]���AV���yj��s�����9�����R��D��M��f,p������2g��3�A$��k<��|�stC#����i"Evm�,O��Z?{\��wk4�����X(�,�I�`�6�4z���z��e�F�
���� ����e4��T����Y���M���F��~4ww�@J�wK��e����������p#�~�g���(����Do���A���WnC~<����]��w{���R�?��"�!�����6�9��J��������K����2�W��:��IS��0��B,4E��#��4O���=��;�&����6�F�"0_s8�#d���������8=A�Q�-�����:�}"7��L�ll�*�2��k�l�&���R#2�5���l��J���i��b,OC���9�r�$��sDY}��5C~� FcI���Z�~;a�R�����~�>�8�ox����n�f����������p�Q����|� \���xw�-.-���h�t����W����|���Olo���K��T��ct������<m�o��3��TF�I������h����q�y~p�����e�7
Qe	�}{;�������~G���%	\����{��~��Z��~>�p��^w�����	T?��hD��W��3%V]�q&0����9�/1C(W�l��5��~���H	�/���k��c�����,�-�����i�w��b���J�B�]��QgN�)q�������g}Z�vw4�����TQ��e�y/����1fEq�]�"���L��#�����x�x�"�p��fc����}>�Gyhd`����1]# ?G�mu�m���Z�.�IkX��kL��u����
T����3�>��I8}�\���������9�����G�������Wg
�{vv��z�h�.k'�>��������.��������h�1����'����}�������}t��_��&�,L�j����Q��~���N��i����p?`�|��<�6�N����!�;�zu��.�/�]��	�����_.Z�#�x���4����v�o>�_��:�~�X�gL�*sB>[���z��
�9=�A�c���W��5L�������b��U��,9G�_a�[����?d1Rw�&��Mgw����IZF�g��������q��Z�������.����4��.��s����_'���`\��/Od�����)L�y����/0���G�:���K�{�S���v�����]�N�����	W���Ej�GX��_���??���_������p
/`uto��+���:��!��r��T�O?���O^��Q]�������o�g587�9���a�9��mr����]����G�W�8N+�l�kZ����KG�M�3B[D� T������?e	�~��Z�n�X�]G2"W{Uk�9=ZY�l"��R���!�a�HHN��4����@?�t�_"��?��]!�������j����G�u!�'�'8c@�.������?��7�H�N�>���4)�5sZ���]�  E��?Pbu��k� |��-4����O���:���t~D�a,�����g��+����q������'���_����cZ����&�m���"��GA\������h,��j���v����ev��s������G���W���&�e(v1��r���-�����]��+�kw�_e��t�Q������_R�����[;�����vqk�1c�OL��jZ?���']���V��D\������[��:v8�����
��8�bCr5�}G �}�<1J�n�����m:���*n�������<�*�ju����z�y���WG�a��l���k��S����x�lT5�d��~P��.%�}��������%�����n�����i���6�P)�up@�41VyR��5}��\�����
���s����=������e|����|;������6Y�����O���3C�������L��	�Zm�<�Z4CI4z������1N^K�r�*� ���R.����W�����1<�A�"L���u�_a�����N+�����5`�Z����[J)�&W*ui���@2�$'C������yU�WaD��$��n)��>rs�mS��m^�Z���u����{�����(����W����������lHo�J~b�R7��v��l�u�zC�
����,�u��"-�o�X�{��U��oI�S���J�
<�cFF6aGR��a��v�����O����C"J�kB(-D���1J���Y�����7�7�.���^���?�%�����6�,���&���6�~p�L@��=N����uZ���1����I$��2F_wd���|
q����O�].������l]4S��'1���o��F���6W(*�
%z�����m<��a����|`���|f��;��N�b��P@0s;;����Ny'n{�5�	�JG���R�����`|s?����w�x���y_��l��`NM�r��W>������[���d�������g��S���t���w�R�������h��� �K�|��e��������u���-��/�J��W�'���g�L� �����)���|�_�l�[������:�������{�����F��z����/>� <2gM���25�.=?t��:����r^�������k[�by�u^�B�=gXx�<�����������������e�y<
;��Q�A��.gu����M�����m�~����l��������YC��+�]�Ny�v��G]1����F��~
��$�km�a�cU��pDi�sF5�l�)=m9��!g������CN�2?gYS�Xk
�3���~��l�b���Q�a��"
���3���,�w��F�N�������3'9s���Mrr��<���6�r���N�q�hz�A����S��Nd;��V|G����z��x�
[N���je���U{�����f�Y�htk��C)���Q�����W�������)��y�S2������Q*R8!1���L�!�T�y��e.���llt��R<Y���9���������O
E8�����L�n�b���3Dg��t��`��������w����,��o��!m���|��C1�?��8���[���"����4FE���7��6�������8�\�����^W���j�z���_�U����:�6��j�����g��S����X�]��Nm9�'~�N���p����"p�5�+%x��z�jmv4aa��Ir�����z��m���U��E���*^����!e�����t��N����h��
�.�w��������.�m����=��������i��)�^S���l��p����^?"w���p}���6p������N*�+�xuu|'4�����������,O{�L�4m]W��'����a3H�m��C"L���u��%�,Bo�pj�o|fB�������3�Px�A�!��zD�����M��<��DM�vz���"�r�\T�w+�h����|�W��n�&$XN��
"���6��+J�x�K���,*h\U����]�'�$�X>
�'��i0R\��	ro=�X�����Gq�AeW�����V6������_��x�������t����,=@@X����?iR8���[�@s�[����;&���W��L�/e��S��h����?�r����z������-F��`rQs�����I^�V��|�-l~in�
�L "U�~���&{�O46fU�|�3v�������M���C��8` lJ��v��T��_��Q��-����GK���vq��R��f9^I�3���/�H��E�[�s3�OF��B*��Q�@�o��!�K����;���_��"FiP�_���-����C������MRB��w���b��&n�s[@��c
I��&�����g�����������?;�W����_D�_Jex`��?���&h�h\�{��?��y1
d82|������T00�c������Y�Z�����[�E����������^�����D���nI�JU�_v\�~��[v�:�\����������t�Gx.�'����urTo�N�O��M�|�=�I���e6����nyc�n�; ?���s��*�T�*�a����?�����9i���O���Dc�����K��&�/��#ug*�29�"��I���*4����I������e��?�_�
��S����4�?U�L������DS\�������������wA1t�&��#�X|������������y2����'� �v�C�[�lH��D4��������;����Xmk�
��ZsF'V�����������w��/Ifl���C����"��������a �
7�p<>�����-�A���9�|&�6����Fv��f�k:x���O�6Z�k��v���/�P�j��|;*8�5oDt���3����X������[T�c���|p�)G�9��L�0�2G�Z�X&�|���_��r��>����s#Oo��SkSE�����p�9�3�l�v%s�&�����:M���(���%�}�(�^�<�6�<�P<��U���J���]���L����h��9�BI�`��H��~�Z�a��B��&,B&�vn���`)��h����u�c��h�j�w�;~��ft7m(�04��Jw��O��N��:D�$���)�%�L��Q3j��dLG�*�E:l62����/(��J���R�����?,������'a���A�i�����H��/$�R�����f.9���L*`���z�
C���B%e�c��X�P.YE������t$��k�S����a>���/2��D�P��]'z���:�����F��iy����}
����:���|s�:E����WX1��A�NS���31��������e�V��r!���
��x>����=j�P��G�b4�����_���������i���Foh���B���|�����B6���0����nVj��Y����g8���S�UbxD����.�Z�����*�-�0�X�E�8B_'��!��O W��8gb����"�9!�
�b����C1d'��i��FL:���a��X�����B[5r�8�	f`#kr^|�_�>s��~���S�2$��a8�K�
���&�o:/�����+z�W���w�G��;��w���kM=���jM�����C8�-���e�*g���MZM��T�������O�0z)A�tX���q�mv��������Bv������O��pAb�����l�{�����p���J��g-�=�"����4khf����"���b#��Sww$#���1QRn;����9�e��d����Y��2{Kq�i����3%�������>��.�"@���(p�����c�l@\d�K����$����r���5?y��QE�MT���	x�HD�������aF�����C�0��3uNF
D�����pzh~2SI�������e+d.�����t�k&z����0���wH|���\����������)7�������$�������9�E��<�n_�sK}�m�9��,�3QDF��3��
���k!�Y/1a�KJ�N�^�'��mll,8V���<��D�<R�[_����X���;?f��B��*�H3@$�������b�ls*�y��tL��8k�R�q��N�v	K�\!DcLu�������i'��:k�-Jk�?���K�������c��E��!��0��N�5�G+���e^#�h��ur���	BLt��m
3��.Z�{"�iLr���P�5��\o��)�N�8��1O�A�I]0���r1fE�4���(\dr��\6�G��N>���%5�P�-��b�,&k�h�� �&���;���O�q�%�B,x����h��n�j���4�R�+i��i����/������\tIh��u�nJ#%i�����$���:�fz~��Fu!Z�:=� � � Mru'B�#���6����A0E�<�w)Y�(�5|C��y��(�LP�v��Q2������p�Q�A��\c���E�76�i�M��c�����1��N�����C�/s<E��Iqj������0%h`;	o�(�:H�n���� '��dp�jhL�g������n����g8�G�� �����9f]��4Wi/5%?��j'�M*��"[��J�9���^�
��g�v�y���
�]o4��[���j�Q��
��@y"y���G��%��}�d���@�;��?�A&/�P�&�(����sY�l��������B��`��h��{,|��~����������?
�����8����3�F=!��?�k����K�}���0��U��Z#�����C������H������:�~D��&��	>�
���y��+"#�M{��y���-&�.L>�=��p6E�c������D/z��A
#Cz0g�/x��:H��5����E��/�[��X�F�%���C�����Ke<��7��s��� �+������V3�P:���!mF�I,��(�;��aF��D�<�����U��6E/�j����NiEC������0�YS����f�N
>t�L��pJ�;?�N
��N�PzQ��@*S�&�,�={s�z��N*bG` @�zo������=�,��10"��B(T>s��U�2��!�mcL:�f�9��u'��!�PF������n�oF�vO�6���a����As
�7.��� _�opN����������e;D��^��'3fj���V����K������5��Q`F�,]�<�����\NR���~�P�um�@����9J��y*oJ�����};$����Of)�--2rg�fn�)%���_�%������1s����I6d��	�$
^�'�e���%�N���������-��=8��t�i��y�upv�P�����I����	q��@F�����G�9QT�O��E�z�-��;��s0�N�h��OJ��#�~�[��8�����XP����>��w��5&�B��_�R%�D}�Wch��������i��V�r����&�D��j��hX���sa����w���c61����@���3���2����_���Q����������YE(?{E�F�]V�����:�D�x=-����?��r�O�r(��z��kj�L������Rb�Ok�H�� 1~GW?H�&��5{���fP3^R�����Und	�k�`���������VH�s�U7<���������c�6��&�0�x�Roi��i�M����s�G��������G����Z�b�I\u�(
b��D�*�!�2R+��Ul����d7��m��D�Q|��W��v�������q���.���V�./y��4�;����M��,��
�C�\��,:&�t�����%w���8)�l����{)S1g��#�@6%��*���}�
���K�f��
��Q1�,���-y�	��"���Y����A��j�����yA��%��[c(BN��7S���:|7E!�c|����M�p�����!����P�j?�NO^7�����d���TB
>�D&�T���\�	J���m�Nu�j����>��0�@����s�F������������r�3��=[6��q:�mM:������R�O����&���,�����=��������h����\����>5h�q?)[��?j��B3����b��|�����o���S�p�5��,A�ZUQ' '�`��`��������8��q�#�����7:�hN�~6�:�'�_�4��Ot��.SG�����4��}yni�.i8�����:h`A
�a���5QqmS�*
�>���9��M�P��xq�G�;XBV�M�&�x���~1��Tt�����
����K���N@��d����S���S"��J=d���!����i���w�w.!D�P�tF���=�>v"� �R����6�
E�I�d�"�JQb�y�?����,Z^�'���=y����J�R�{�	���E�y��*��K>
Mc��wy�����#�a���������W0�?��0S�F�t3���c��.��W���kR�f�iK�D@�h�('��G��mHM1cZ	�'i^��L��E 
?��`�����b���#�Q)�Q�=�h4�����?c�W5���R>����}fL.S�����7�B}Gv�>O20�y����8��|�+>��_�=P]�(V���)�H\Fo��v!�vg� c;W��g���1J����������6�H�����~/�\��5W��*����KJ��>|�������^�/I't$Q6(��.��d��eA:"�zs�e1������O����U�k�N��c���[)��%���|pf��[��&���r��!;���q�������BB	���:��
�\�H&����������l���&m<��!�*�SN;A�L��:��{��
c�
<*0eBV��P��!Z����S��>�����~��!c��$��>�c]_Xw`;���g���&����dGX���I(��_���a�p��q�v����;g?�����%��������]X�j��s27h�?�mkEePMF�'�/^��&����;;�I��f��<��q�@�NI�M3&����{wG��DF�6�����cyw���p<�x�w���i��!O���-���^ ��r����;@���.��
���-v�kGk����"tmdb���9e!��j	�c��4���G��h�Ip�
�/w��	���P)�[�m����MYb���{��dM�
Y�����9s�R��c���0�13���X�l:����R��M���u.#m�sP��m<��^��q��r��Q�I�dK�}<1�^^�"��y0k��m�u��A��J~k��S�an���8:����4�8��lpG�������l/����W��
���;�>�p�	�xS��\�I�S�����n��M��,,z��8�_R!����ixZ�k��`�<k�m������!A.��(�������1�26����y�N�u�Zn~�1��&_�+X�|�Q%4��A%�9�f76q2�sC:���|�a�b%�����8���w-O���i6��r�\k
.v����Y��_�R9E}��]����b^��&/!�������q���^YG[$u[G���Pw���5J�2m��8�f�M�
�B�/#��0�����"j�����/��0���Ji�7�P��6�%s�~4����w�����1�B6pY��!���l���h-D��C�}��-�����3���6��~� i/�b���<K ���d	��������e�w����k��x�����Q�����:�>�����B�@�d������^/ha&�u��E��*Ac}d�����QJ�`������A��[(�O�=�/z�3	���Zz�
��L�8��|�,a��]I�D�Z5c1���b�>,�)���H��H�o��9.�������bD�3^����'�{�%<�Zj�Au��:��JP�YN?��`��gQ��`M����%���0"��F(����2=/��T_���\�%g����Y��+����X!�8���.������r�/E/��WN���	�$r���[���%��O_W6�-L�t��;�<Q�������#��p�{��%&
�xt�����i�za��HM��du!x_m��t��'T�qo�����)O�v����0���E�Y6D�nD��CEsS�Ozx�sl���yX��7��g��5��=�"o��7Q:��������)�HZ�0�F%����G����h��s�����z�e��C����y�iou��8�L.�g��?d �{3��1y���dx�F��������o��p�x;�8��>����c��$j���'N��L�\>���<��2�B�q]�F
�@�(8����Ba��l,���JO��-L������4��k0^�Ymi���g���{`�s�`p�Pb���9�^�(!�b�>������4
�x��6����Q�}�P����N�\�4'|�����������e�U=wFM�'���HL���,���p/F��G������Ga��Y�+z�	f9#�~�����]��B|��'y�� m~�3iD[G�v�������B����y`�����k�n-�N7�#�8^����t�j&y�%8��"n�wl�}t�XT�E8�pm�/�X]l�*v����F5C��d��)*��q�m
��V��Ep���$����e�4F����Vu/1�0M{��C��1/��~���zB���Z}���jiUQpp��P��#�����-�*Y]��hIKMN���A�s*pE9��&��O�H |�"�M.�[+K��F�hkas{�����d�8����9V����Pf��X
z�d�`CQ�N��Q���T@HB3�S�B�.�pO;tdi��x�)����,�������J��FV{�%1p��=:������Mt��o��)�Cb�����n�
9�`�m��y���~����UIU��c�$v��C�����	C/[ z�������v��~�R��q`W���x!��<�[��Po�������9kr��N��2���;�p������'7:�y��&
m|�d�����:�"Ho�
������\�'����S:�13�LY�/��9sr���,,�I��L���9��IST�qF.�V�s��	�`>���B������s�M����Jd�q��������_���LQ�����u���g�1�	�'v���p	���4f��]�����������1�+�������1O���1z�L0�k	��5�����M�JM�����i����,%�n�a����7�|�i@
���^�I�,f]J:����6�i1�������|�����E�� _}9��`��m]�{�(jwQ6�l<�[f�X3�$��t&-wHyF�2gw!��R80�(uLD��q	�����SK�`�� k�Z�zW�U=�������HQ�����g�bG��r���	e��9OO���!��,��O�]�b��q�M���X��������-k �:�HcEM�������ft�����G�����-��H'���{C���/:^L?���R;����;��z���0�N�u.�)��U:ldA��D�C$6�+WM�I�����"����V�oj����f��m�1����&��-������,1����K�H�����O�kB@`��;�'���I\#�@����%"\���P���1����L��`H�N�r�@�~�c���&��y�y�����!�����n.^-�)D�+�� �E(
�#E-���Q�
��4>M���|�
����/��q���dT���7\�wr��c�t�}(��R�����9. b������/(�pM1����a��W{�\1,wD��}g��Q���uL�}	�O�f��:i�.���d@P�:��+� �0R�
E��\J�����+{�w��I�]���0e�t1�8�pw�>��3F���|��8�q����8���Mt,�9�����
6l9�l^�CZ�?uC���5[, ��Cm���@���^�v^T��B8�O����Y�p�B}���D�p7Dc<��Y����+��.e��g�f�+����������[RR�d�I�K�x�>i����+]�`b�.I0��;�'��^��r���2A�1J�����0Z��p:���U���:�7N�&-��X����r�1�7dv�$��Z������7�J!���YV}..g��+Z��j����'|����$�[��a��B��S�K���=���"�!�v
2`�����YQ0S\�Ec����U2U]$S�����(3#�)���(
>�f�Dq!2WA�B���5d%I��Y�Wul�`���j���_5��s�l�
��X�o&�
�-W��p*���*���$������("���}20X�1����K���E�t�^�Q2A�A��o��	���S\m�cm5��%.9{d*��,yV���.�8'�^p�--������������FO����K�gP�����g>-��K�\�jV.�I��R��w����yiz�����<!f���a'8b|#v���R*!��F����qF>����w�P��@�K�m@�-��9�LK�#�R~(���\�O�
��;��:[�7&�Jh`��.��dX����q.?�����a��3E�-�-�S��;j�0a�B��t1q������P��������Bk�l��A���A��.����<E��{8��t�3����<C�e&�q�w3�5���g.Ls�[P�����)0���L);������w�Sf<��"���L����Wz+>�%������]�dl��L#p���%qi�
<�3�-���Byp��I�5�D���3�����u%�u|�8**�L3��/;P�3|��.��o^`$�"o5��eK����*I<������N.��k��������N��NAP���R
��y�����C`2r|�*p���[����izH��xZ9sR9p�I�Iq�i3�u�A<�]���!-%}Fi<�(�3��W�������>��}|`N&Sg�f��8D�5p�91>f� qVr�0foB���,���I���+D��2��+���DL3T���b�A��d�aH6^��������8O��3�7����{}��{�AI��~��D���&������4V�L<��?�ud�������8�#Ar���pr�&���.��RyP�%��(����b^3kz�����"�t*���z�	����R�P�N�7�x^'����3���zf�:�L�����8=���9��2>�N�����Xd_O'��(E=���$gv�kq�������p����u�l=8�1��B?�J3���)�O<���	v=5�t*��Z"�toe�IM����l�-�3�V�t��@H���kIS�Ydqf6����)�"F�q��R2G����^s�@��mT�2��K�/�U
j���]��-X��- �QG7��f>P��m�2W�F�(���Y;��=>��y�X�b�p�SZaQ�,�X.{��%C�1x���=7�p��L��s�*��;=}��
��L��` T���Dv��3r�&����ss�:��h��(�i�����Q�O�~(1^�f���@Yu�k�S�8�?G��z9M���oF��iR�O"�'�;���~��E5_Gv�)�/&o���5�sr���S`v�yOo��T��T<��L���L�_���n�.mj�H��X���D$�a!Z�"���u���&z�8o��� ���rEZ�<>�7!�b���Bq��4���s���������^�B�PM����(5��"�
�qXN*&���V/3�<C_X+���Eu*�PL1�ywS4����"�e�N���l.;�!/�����xR�.�% ���e����_.�!=J(J�~�,�D�3�0 b�����c.��F�����I�=�E�Mi������::�tu��&ZAu"��-p�Y�>���$�3���k��jl*7T���)��8��qig�������
���
Y]�{0C^�����~�\M�����/'���!�'6!"�3��1�
G��*v[��E�Pv�:H��~�6���Hl�����)*����3�Vx7�A����3j.�UJjM��?����DbAn�sn�R�H�V-OmXj���Ke�2w����V�F�*�p�W�kD����,9�@��J����3��s���D
�����_Ev���g����,��yx�5��%�t����v"V*��K2vk�tE5���Z[����sq��c�$��{�6�{&������S�$�%	�=I!��+ ���?Ag�DU�E�}��e���{�I���jq�k������!���t��Z��S��1�S�v�q��H[6)�r�y��j=w@�	��������+9���v�*�;Y���U}��[|
�^���;J$�g���G�r��M�����Y�.f�*��������N���Z�s�N �R������r+"I������'�-p�;D�}o�8'���r��oQ�
ze��l��u�\��t2z��3����V��f�l�D�#hz����]og�^!�<�T�k������{f--3�,�
a^v��t�"q!a�G�Dw<��aT_�����	���q�1��PbS��\U�w�g}��p�����Ue�GY�s9?�uHW� �:�A��~�X�(� �]o�T;�;�N��u`je.�G"Q�~*���������Z�<Z�8�"��/��c����E�6|	V"��_�RVO�ZJ��t.�xx�����A�+�x�����K�vH,���}��h�WK����C;:�;��
�$8�����g�f"��[
������/�_(X}^3\��JJ�t6�?���Z�����Wa��~)���u{t7
7��A�	���5��%��L���G�����B)���A1D3>q�a�_����m���?�OF��K���Q��~��v��]�g'"�g�2"���u���H��19�13'��	�8��|�kDR�6]A�;9�!����R��(MJ�� ��8�MW��i�Je�KH���8�Fr�G���u��*��"
g�KW^�J2������ ���2:�c���^�0L�������N�<��1��P��#�.�n�!{�1�����"��<�����x�(�8���zqi��g��	$����^^@����
����H��*��v�u}����v�U�D�����%�I`��
|�eV����s</�A�S�cs�_�!���*�������|����Na&?@q�y?`�3�����::��~��{�;%�a�S��G�~x�M����|�����o��I	r ~eI��dq�a7�PP�������m~�Q�
�-~���6�u\�����a�
�S���iB��xFI�\�uS�qm3H�~���d����
��a����t�y4�2����?�%�b��I?��A����C�%A�q��NI@����oyV��S�S](VJ����&n:D�SS�_O����.SZ�����kx�OI��f��l�Kv��
���4��*/z�_v�)0�i�{�w�F-��^�vG�&�������:x1����������nb;8�����f���	}WN�1��AeK�u$�bi����9�b���!�RB3n��X.o��='@#>��9D#����m?c&�3N�a��v:��5���F�F�9��p��U����.����Qb/�8��	uF|
E���R��y��s\)�pNwx�F��(������Y���_�����ht?�,����]����)I5-�/!���Q�;��C�u��dh����9(�r�yNG�i�3����g@�����U{�zxS=�7�/F�q�Y����T?U��9���^.`n_1;IO~��%
^��V�*�I���R���������2�Ce��c��<���S#T������G��	��TI���Y����n�t�L���f���]��Ea�~b���V���LG�<L.�����=��y�W�3���Se�T*V6�e�K�`JK���|qZ;i�����u} S��j������j_�T����nZ��Z���UW�����:]w����X��
��0��
M`����f��~�]�PPO����0�
lWeR���.���8��������;t_�'X�7�\��4Z�Wm��3��	Z���<w�_\�/@n�Y��	0c�RY�vf��Pg����Q��~k�zr����}��~������?�_0mg���}�]����8�[0����=�K��J�Z�2�BNe����
�{��M���u�P0S�r��������yKe����7��1�N��]?�vz ��_�o�^�u����D��+
'/��K�n�����L�n��U�1��4�B+ 	e
J����x�|����$�������3�����z����7BCd6��+B{�{�h<���pFI"(���v���e�~������D<�N���fu��	�h��%	����/�8�I����a`���s
_�������=����;����D�HV�j����.��|>����*��"��vQ���0���oM�S��I��*E��(��q��
:��B\y���]��1t���r:�%��vi��]���3�/>��@��s\D�9���SM�PYY;l��7T���~���r�Y.������7������v"uN*������(�aG�����4�u�0=��Rkp�|�w��nEQ�P�q"U�0#���-^�4['�M�D�x�!��h��;�������v���r�����n1��x2�n��6[4��lKe�W�Tv������p0��������p�;g�XngV�������-���GF<��j�������0����}�W
v��~JL���F�~_A�������*���r��*�J
���WU��M��*�>�7/���N�JW"Z�����tX��p����#T%���������{=c��w#���B���#�r/���?��e����O����N�%���2��]��*���;U��4���O�x�����`.Ey0���������JfFcn���M �
j�������R�h##;X�����~\�&W��&��wS��N�/I������N��XR	�_h
���������Ei�Ey��gc��c����-=l�i;�������^ly����^��t�6�
�-@4�f�SR�R�Y@b2���O�_�N�� Zk�Q|i���Q�����=���a��4���9f���)��gp�2�;#���6���0��|\cS��S����i4���h���,��v&?���������$|p��j�>��-^�*f�'���K��Rq�Q<��]�y�m^��)��v���<y$ ���2
�_�0�=H���Rz��/W���h`�r��,���i�Q��M�T�.�8o�_5���fA8V���x���$�����'���xWI���J�U��n�Ki���.�S����.\]6�/�%�����~��	0����;��.�Q�u�Jz!��CRl3��B[?�3�F��A�gq�d�~F5�:�����h�^�����Z�Rs/��������������lV�r�(���
�1���X@S�����xr��5,>�O�.5��t+vUZ�-��*�\r���c�F�vw0����S�3Pc�Sq��Q���!�
U�t�})BEB2n_?���?�L����Oh^�`7�C��LO�H�U�������b��SN�5B1��t�_���Z�#�����������G�bo-
���|�n��dJ�������G����;��%QVN�g�R&��gcy���S�C�\K�g����"�vq�\��~r����)q������P0\�X^���}��<�yj�^�-��5��\r����o�Y���7>�b���8Z��������$��D�e9�����QndV���A��#�i���o��1�$:+f�0�P���E�E�m���-y�]�W�g�����D5����T(����~�8?�7�:�_�+YU����$�1J[(�3^������&����)R.����������y��\���wiK��cv���Q.W�wLJ������Gn�re�X��y)|`x���*h�}��Rm�JE~C��k��5/����5��Z��Mu|~�~��^�-���o�Hl7��;��[���lg������mIV�&�|�A9�tQ�]w"m;������yL�wduy�(�I�d��
�����v�T��w�������t��b��~6z�����]yO�q�HP�qPu�Z�s/��tL�a,��[e\�G;���3���� S�)�e�i��c�/+���A��clun��r�C�{�B����{j��L�x�M&�%X��C���3Wa�6�|RV�	�t!����]���d�*�@���kXL7EQ��r8��c	Lnx��~K���6,<f�_�F���4����%�K����y��X� �d/�;K]����M_#���J�Njv��R�e����iT�������I%rb�.�>���m�[��I)����E���zl��q8��Jpn�|��3&�7����I��t�u����t)��I�^���9�l?[��������!��{������<~D�@XV��)��~5���h)w��Zn�]�)|��VXp�G���������O]�
_q0D[�
��|>x�����Vc)����Y�_���n�K��Q�`
r����<�[�f��L����r[���q21(������$��hZ/(����d�%�=�����:�Wc���1e� �Izt:�=d{��27.������.���w��Oa�]��"�C�u����#q�6�l�~��t�H��r�����;��'�J�aOz��z���W��~��u3�?�v����t�N'��������d�U��:�av�^8�����$����
��g���u���������C/���s����Ouimw�������W"uM�Z��Kym|�[��d����P�>���-E���ezT����1�������y�c_E��~���S�&n�N������qx�s���A�_�n��{�sR�o�������Z�D!�HZ��)5��� A$)	�;�Rq��nS/0���0�`��'Y�iv�s�T�G�t =J'�=���M�m���@�
8�8����C����x��8	���2�����)X����3�Nh�Q� ��<��q��H�]�
��kb\���d��i]�V����1\�	��~���I�c#����S��
�����$���I}��(e������Qk�����1T�r(�O�^���}|Y���4[�`O�\f'~���*���q�AgO2�����u�=1��4'�Y��������Y�1�f
I B,�t N����:=?�����L:�e�=ys�`A��	MQ
����^`�4�le@cS*��WS������sZ4�.4W���������Z�m�&������O�C�}�y����'�[b��S|��1�z�������'"o��-_R�)y������������cJ>|krO��by�a/~�Rs�?5��s[��/�����zNO3���T��b��0���0P*?
�I+TH���)XG���RL����"b������uQ}r
M���)f��2�u
��������1�����'n�# x,N$qF��}g +���F��l
�tC9[%�&#E������d�`�H��`�v[�����pvR� m,D���2(�'�z��k��� �1
����(��x`���6��aJ��a���E��BL�-��"l�>���8?�����FB:H���"�h�>~�C�8c��u�@����
�r���������j�}r0�J��+��!����;z�\a��$���=1�nr^�K�+E��S�fM��@!LED�.�>�m���B�Zd��eqL��/uN�[=�?����(�����!��)�������������X@���-O�D�E���:�]<�����}]�����
������j\���'������O��+��R��)�1���J�D�t+r�
��"���]����c���_j1
��2V������lN<�p��A.�4�f�#��mV2J�5�<q>���{C{��^d��7Z�R�gUq��y��:�I�8����er���.�M����mL_/�e�	sZ�_���-Gg]`���5��4���1��A��r)���R���,������&U	�i@�����<��T�i�F�=K)S�4�"�7���8���pXTj��$=��L8�h�����������o��(����/^��=[aA����k��p�C��G���oS�
����`���6L��DB�@�#Y��^��1���.���TjT�e&��6��*��1pRS�_
�G�t� =��9��e�b��Qh��nz�L��U��[�%Ip@��,�
���D�M��R!�F�et�N�d���F�����u�
�2=�`������KxI���������p�MT���������;�$Brt�s�c���O9��RD�H���,��Pr���.A��L8�<"��o�O����������y�@��N`��A�Xf��/�������~��W���?�9y���b�cTr��]�,��E���_��s]�~q�G��F��g���E�T��q����H%n���}s���v���by{�������u������EI����!���q�$7�Hz�������[�I��������M��J��1�B �rb
�|�{�R{hd@)�s��n���1�)�`���P����{z< ��o�(��l���a���=�4$hP�v���V���r��&Y��L��&�6+E��g	#ZQ=}�A-6! )��O�	��8N�]���(�WS$�51Kx2,�ci��@�dJ-�e8yGWA<VTv���Y�}�&������"��
:�����L{�Z��4�cuN�4n�BV��Q����{��q2�2�b�(�B�������(���$�L�������A�m6��>dnM?@��J�^o��
�x�X�V+r����7c��n�|��FVTQ�����Yh���n�$u*��"�M��f��~ir?�5��@�4��@��������e���������6����_:M6�����F���@Y��%�<�~�#�[$�$�G�b��ji;��s�%�t{o���o��?7�������q��o����H��>R�}7R9���AT�����*)�� 3O����^��B���8��WG���#��p����$;���	v���; V�1�:b�M�W)�9Af��qqd�%D�|G�e�q}��
1���z�$�N��	6�������tM���^�V{.�e��V�6���U'�w�=������2�s6=����x�ZS5�����*�jFs��jG��K^�'�����?MK��j2�(:Q��e��:y������x�'8������r�p����R�t����t�U%:V2}��9k��j�J�y$��U�~X�m����G�� �:yZ/�flN�/fu�2o#C�Z����T4@�u�3���;��������cb�aJ��L*��v����`��Kk��s�S���B�Z�W�b�MLMI��]���M!:
M�� ����:�c�J&H��:�zw���..)-|���FH��G�K�������$���p��6R�����c�.SP.a�G;P�8���2�������S����(�v�P��������'��9vCLh���\>�L�cJ$��3��7�I7���d��}��lj��S�oC��
�	Mf(p�Nb��Kl���>	`%<��P^�o�	�]�����loR2��V)����Z�
���0�I��qv��$���(��}��U�,��1�\��e���@����~V���{T��hgw��Y��G����W)o(�
#2Dann Corbit
DCorbit@connx.com
In reply to: Neil Conway (#1)
Re: updated qCache

-----Original Message-----
From: Neil Conway [mailto:nconway@klamath.dyndns.org]
Sent: Wednesday, April 17, 2002 2:18 PM
To: PostgreSQL Hackers
Subject: [HACKERS] updated qCache

Hi all,

Here's an updated version of the experimental qCache patch I
posted a couple days ago (which is a port of Karel Zak's 7.0
work to CVS HEAD).

Changes:

- fix segfault in EXECUTE under some circumstances (reported
by Barry Lind)
- fix some memory leaks (thanks to Karel Zak)
- write more regression tests (make check still won't pass)
- re-diff against CVS HEAD
- more code cleanup, minor tweaks

However, I've tentatively decided that I think the best
way to go forward is to rewrite this code. IMHO the utility of
plans cached in shared memory is fairly limited, but the
code that implements this adds a lot of complex to the patch.

DC% Why do you imagine that the utility is limited?
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

I'm planning to re-implement PREPARE/EXECUTE with support only
for locally-prepared plans, using the existing patch as a
guide. The result should be a simpler patch -- once it's
in CVS we can worry about more advanced plan caching
techiques. Any complaints/comments on this plan?

DC% Why not allow both kinds and make it configurable...
DC% local/shared/both.
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

#3Neil Conway
nconway@klamath.dyndns.org
In reply to: Dann Corbit (#2)
Re: updated qCache

On Wed, 17 Apr 2002 14:34:45 -0700
"Dann Corbit" <DCorbit@connx.com> wrote:

However, I've tentatively decided that I think the best
way to go forward is to rewrite this code. IMHO the utility of
plans cached in shared memory is fairly limited, but the
code that implements this adds a lot of complex to the patch.

DC% Why do you imagine that the utility is limited?

(1) It's difficult to tell whether a given plan has already been
prepared: the server could have been restarted in the mean-time,
for example. We could allow app developers to check if a
given has already been prepared, but that's inconvenient,
and the benefits seem fairly small.

(2) Shared memory is a bad storage location for variable-sized
data, like query plans. What happens if you're asked to
cache a plan larger than the free space in the shared cache?
You could perhaps free up some space by removing another
entry, but that means that every invocation of EXECUTE
needs to be prepared for the target plan to have been
evicted from the cache -- which is irritating.

(3) Managing concurrent access to the shared cache may (or may
not) be a performance issue.

I'm not saying it's a bad idea, I just think I'd like to
concentrate on the locally-cached plans for now and see if
there is a need to add shared plans later.

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

I'm planning to re-implement PREPARE/EXECUTE with support only
for locally-prepared plans, using the existing patch as a
guide. The result should be a simpler patch -- once it's
in CVS we can worry about more advanced plan caching
techiques. Any complaints/comments on this plan?

DC% Why not allow both kinds and make it configurable...
DC% local/shared/both.

That's what the current patch does.

Cheers,

Neil

--
Neil Conway <neilconway@rogers.com>
PGP Key ID: DB3C29FC

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Neil Conway (#1)
Re: updated qCache

Neil Conway <nconway@klamath.dyndns.org> writes:

I'm planning to re-implement PREPARE/EXECUTE with support only
for locally-prepared plans, using the existing patch as a
guide. The result should be a simpler patch -- once it's
in CVS we can worry about more advanced plan caching
techiques. Any complaints/comments on this plan?

That's what I wanted from day one ;-)

regards, tom lane

#5Christopher Kings-Lynne
chriskl@familyhealth.com.au
In reply to: Tom Lane (#4)
Re: updated qCache

Neil Conway <nconway@klamath.dyndns.org> writes:

I'm planning to re-implement PREPARE/EXECUTE with support only
for locally-prepared plans, using the existing patch as a
guide. The result should be a simpler patch -- once it's
in CVS we can worry about more advanced plan caching
techiques. Any complaints/comments on this plan?

That's what I wanted from day one ;-)

So with this scheme, people just have to be careful to use a connection pool
/ persistent connections?

Chris

#6Christopher Kings-Lynne
chriskl@familyhealth.com.au
In reply to: Tom Lane (#4)
Re: updated qCache

Neil Conway <nconway@klamath.dyndns.org> writes:

I'm planning to re-implement PREPARE/EXECUTE with support only
for locally-prepared plans, using the existing patch as a
guide. The result should be a simpler patch -- once it's
in CVS we can worry about more advanced plan caching
techiques. Any complaints/comments on this plan?

That's what I wanted from day one ;-)

You know, if we had a threaded backend, we wouldn't have any of these
problems :)

Chris

#7Karel Zak
zakkr@zf.jcu.cz
In reply to: Neil Conway (#1)
Re: updated qCache

On Wed, Apr 17, 2002 at 05:17:51PM -0400, Neil Conway wrote:

Hi all,

Here's an updated version of the experimental qCache patch I
posted a couple days ago (which is a port of Karel Zak's 7.0
work to CVS HEAD).

Changes:

- fix segfault in EXECUTE under some circumstances (reported
by Barry Lind)
- fix some memory leaks (thanks to Karel Zak)
- write more regression tests (make check still won't pass)
- re-diff against CVS HEAD
- more code cleanup, minor tweaks

However, I've tentatively decided that I think the best
way to go forward is to rewrite this code. IMHO the utility of
plans cached in shared memory is fairly limited, but the
code that implements this adds a lot of complex to the patch.
I'm planning to re-implement PREPARE/EXECUTE with support only
for locally-prepared plans, using the existing patch as a
guide. The result should be a simpler patch -- once it's
in CVS we can worry about more advanced plan caching
techiques. Any complaints/comments on this plan?

I agree too :-) I think remove the shared memory code from this patch
is easy and local memory storage is there already done.

Karel

--
Karel Zak <zakkr@zf.jcu.cz>
http://home.zf.jcu.cz/~zakkr/

C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz

#8Karel Zak
zakkr@zf.jcu.cz
In reply to: Neil Conway (#3)
Re: updated qCache

On Wed, Apr 17, 2002 at 06:05:59PM -0400, Neil Conway wrote:

On Wed, 17 Apr 2002 14:34:45 -0700

I'm not saying it's a bad idea, I just think I'd like to
concentrate on the locally-cached plans for now and see if
there is a need to add shared plans later.

Yes, later we can use shared memory buffer as "pipe" between
backends:

Backend A: Backend B:
local-memory-query-plan --> shmem --> local-memory-query-plan

In this idea is in the shared memory one query-plan only and backends
use it for plan copying from "A" to "B".

It require persistent backends of course.

Karel

PS. it's idea only and nothing other, the original qcache was idea
only too :-)
--
Karel Zak <zakkr@zf.jcu.cz>
http://home.zf.jcu.cz/~zakkr/

C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz

#9Karel Zak
zakkr@zf.jcu.cz
In reply to: Neil Conway (#1)
Re: updated qCache

On Wed, Apr 17, 2002 at 05:17:51PM -0400, Neil Conway wrote:

Hi all,

Here's an updated version of the experimental qCache patch I
posted a couple days ago (which is a port of Karel Zak's 7.0
work to CVS HEAD).

I have a question, what the Dllist and malloc()? I think it's
nothing nice for local-memory cache too.

There is needful destory cached planns by one call of
MemoryContextDelete(). I hope that Neil wants still use
original "context-per-plan" cache.

Karel

--
Karel Zak <zakkr@zf.jcu.cz>
http://home.zf.jcu.cz/~zakkr/

C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz