pool_memcached.h is included in pool_process_query.c
I forgot it.
> I got compile errors after applying your patches.
> Forgot to include pool_memqcache.h?
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp
gcc -DHAVE_CONFIG_H -DDEFAULT_CONFIGDIR=\"/usr/local/etc\" -I.
-D_GNU_SOURCE -I /usr/local/pgsql/include -g -O2 -Wall
-Wmissing-prototypes -Wmissing-declarations -MT pool_process_query.o -MD -MP
-MF .deps/pool_process_query.Tpo -c -o pool_process_query.o
pool_process_query.c
pool_process_query.c:55:28: error: pool_memqcache.h: No such file or
directory
pool_process_query.c: In function 'pool_process_query':
pool_process_query.c:112: warning: implicit declaration of function
'init_buf'
pool_process_query.c: In function 'SimpleForwardToFrontend':
pool_process_query.c:1173: warning: implicit declaration of function
'memqcache_register'
make[2]: *** [pool_process_query.o] Error 1
make[2]: Leaving directory `/home/t-ishii/work/pgfoundry/GSoC/pgpool-II'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/t-ishii/work/pgfoundry/GSoC/pgpool-II'
make: *** [all] Error 2
2011年6月19日23:44 Masanori Yamazaki <[email protected]>:
> > So where is new document patch?
>
> I'm sending new document patch.
> I described the way to install memcached or libmemcached(c client library)
> for memcached users.
>
>
> regards
> Masanori YAMAZAKI
>
>
>
> 2011/6/19 Tatsuo Ishii <[email protected]>
>
>> Forgot to attach patches.
>> --
>> Tatsuo Ishii
>> SRA OSS, Inc. Japan
>> English: http://www.sraoss.co.jp/index_en.php
>> Japanese: http://www.sraoss.co.jp
>>
>> >> 2011/6/14 Tatsuo Ishii <[email protected]>
>> >>
>> >>> Please explain what is implemented and what is not implemented in this
>> >>> patch.
>> >>>
>> >>
>> >> What is implemented in this patch are as below.
>> >> - connect to memcached.
>> >> - set RowDescription or DataRow on memcached.
>> >> - get RowDescription or DataRow on memcached by using key of md5(SELECT
>> >> convert).
>> >> - delete cache on memcached by using key of md5(SELECT convert). only
>> >> module.
>> >> - fetch and parse the fellowing data in pgpool.conf.
>> >>
>> >> memory_cache_enabled
>> >> memqcache_method
>> >> memqcache_memcached_host
>> >> memqcache_memcached_port
>> >> memqcache_total_size
>> >> memqcache_expire
>> >> memqcache_maxcache
>> >> memqcache_cache_block_size
>> >>
>> >> - add data to buffer before set data on memcached.
>> >> - get buffer in order to set it on memcached
>> >> - initialize buffer
>> >>
>> >> I am implemented only in Simple Query case.
>> >>
>> >>
>> >> What is not implemented in this patch are as below.
>> >> - shmem cache.
>> >> structure of managing table oids.
>> >> the space management map.
>> >> on memory query cache structure.
>> >>
>> >> - implementation in Extended Query case.
>> >>
>> >> - cache validation.
>> >> The result of SELECT using none IMMUTABLE functions is not cached.
>> >
>> > I have made a patch to implement a function which checks if a SELECT
>> > statement includes non IMMUTABLE function call.
>> >
>> > extern bool pool_has_non_immutable_function_call(Node *node);
>> >
>> > See attached patches.
>> >
>> > TODO:
>> >
>> > Some statements including:
>> >
>> > SELECT current_timestamp;
>> >
>> > is not detected by the function even if it uses IMMUTABLE function
>> > because it is translated to a non function form. Obviously we should
>> > not cache the result of current_timestamp. What should we do? Probably
>> > we have to have a heuristics to detect the particular form?
>> >
>> >> - remove cache
>> >> If cache is full, the least recently used cache is removed.
>> >> If a table is dropped or modified, related cache data is deleted.
>> >> If a table definition is modified(ALTER TABLE), related cache data is
>> >> deleted.
>> >> If a schema or database is dropped, related cache data is deleted.
>> >>
>> >>
>> >> This week I am mainly implementing the shmem cache.
>> >>
>> >> Regards
>> >> Masanori YAMAZAKI
>> >>
>> >>
>> >>
>> >>
>> >>> --
>> >>> Tatsuo Ishii
>> >>> SRA OSS, Inc. Japan
>> >>> English: http://www.sraoss.co.jp/index_en.php
>> >>> Japanese: http://www.sraoss.co.jp
>> >>>
>> >>> > Hello, hackers
>> >>> >
>> >>> > I have implemented a function caching query on memcached.
>> >>> > I am sending the patch file and it's so nice to give me some
>> opinions.
>> >>> >
>> >>> > Main program which I implemented is as below.
>> >>> > - Search for cache data on memcached by using md5 which converted
>> SELECT
>> >>> > into.
>> >>> > - Set data on memcached. The key is md5 which converted SELECT
>> into.
>> >>> > The value is RowDescription, DataRow from Backend.
>> >>> >
>> >>> > [Modify files]
>> >>> > - pool.h
>> >>> > - child.c
>> >>> > - pool_config.l
>> >>> > - pool_config.h
>> >>> > - pool_config.c
>> >>> > - pool_system.c
>> >>> > - pool_proto_modules.c
>> >>> > - pool_process_query.c
>> >>> >
>> >>> > [New File]
>> >>> > - pool_memqcache.c
>> >>> >
>> >>> >
>> >>> > --
>> >>> > Regards
>> >>> > Masanori YAMAZAKI
>> >>>
>>
>
>
>
> --
> best regards
> Masanori YAMAZAKI
> email: [email protected]
>
>
Index: pool_process_query.c
===================================================================
RCS file: /cvsroot/pgpool/pgpool-II/pool_process_query.c,v
retrieving revision 1.259
diff -c -r1.259 pool_process_query.c
*** pool_process_query.c 13 May 2011 06:53:05 -0000 1.259
--- pool_process_query.c 19 Jun 2011 15:10:30 -0000
***************
*** 52,57 ****
--- 52,58 ----
#include "pool_session_context.h"
#include "pool_query_context.h"
#include "pool_select_walker.h"
+ #include "pool_memqcache.h"
#ifndef FD_SETSIZE
#define FD_SETSIZE 512
***************
*** 107,112 ****
--- 108,116 ----
qcnt = 0;
state = 0;
+ /* initialize buf for caching on memory */
+ init_buf();
+
for (;;)
{
/* Are we requested to send reset queries? */
***************
*** 1163,1168 ****
--- 1167,1178 ----
query_cache_register(kind, frontend, backend->info->database, p1, len1);
}
+ /* save the received result on memory for each kind */
+ if (pool_config->memory_cache_enabled)
+ {
+ memqcache_register(kind, frontend, p1, len1);
+ }
+
/* error response? */
if (kind == 'E')
{
_______________________________________________
Pgpool-hackers mailing list
[email protected]
http://pgfoundry.org/mailman/listinfo/pgpool-hackers