<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi, pgpool team:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
  I'm using pgpool as my cache for postgresql, my question is, why I can not cache this SQL:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
              /* sql case1 tile */
<div>              SELECT</div>
<div>              'cluster' AS type,</div>
<div>              'case1 tile' AS log,</div>
<div>              NULL AS zoom_to,</div>
<div>              region_id id,</div>
<div>              centroid estimated_geometric_location,</div>
<div>              St_asgeojson(centroid) latlon,</div>
<div>              type_id as region_type,</div>
<div>              count(tree_region.id) count,</div>
<div>              CASE WHEN count(tree_region.id) > 1000</div>
<div>              THEN  (count(tree_region.id) / 1000) || 'K'</div>
<div>              ELSE count(tree_region.id) || ''</div>
<div>              END AS count_text</div>
<div>              FROM active_tree_region tree_region</div>
<div>              WHERE zoom_level = 8</div>
<div>                AND tree_region.tree_id IN(</div>
<div>                  select distinct * from (</div>
<div>                    SELECT trees.id as id from trees</div>
<div>                      INNER JOIN (</div>
<div>                        SELECT id FROM planter</div>
<div>                        JOIN (</div>
<div>                          SELECT entity_id FROM getEntityRelationshipChildren(</div>
<div>                            (SELECT id FROM entity WHERE map_name = 'TheHaitiTreeProject')</div>
<div>                          )</div>
<div>                        ) org ON planter.organization_id = org.entity_id</div>
<div>                      ) planter_ids</div>
<div>                      ON trees.planter_id = planter_ids.id</div>
<div>                  union all</div>
<div>                    SELECT trees.id as id from trees</div>
<div>                      INNER JOIN (</div>
<div>                        SELECT id FROM planter</div>
<div>                        JOIN (</div>
<div>                          SELECT entity_id FROM getEntityRelationshipChildren(</div>
<div>                            (SELECT id FROM entity WHERE map_name = 'TheHaitiTreeProject')</div>
<div>                          )</div>
<div>                        ) org ON planter.organization_id = org.entity_id</div>
<div>                      ) planter_ids</div>
<div>                      ON trees.planter_id = planter_ids.id</div>
<div>                  ) t1</div>
<div>                )</div>
<span>              GROUP BY region_id, centroid, type_idtreetracker</span><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span><br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>In the SQL, I guess that's because the function `<span style="background-color:rgb(255, 255, 255);display:inline !important">getEntityRelationshipChildren` make pgpool ignore the result of this SQL? This is a function I created by myself, it would select
 some other table and return the result, basically, I hope it get cached.</span></span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
According to the document, there is a setting called `cache_safe_memqcache_table_list.` but the document says it just support view and table, so, how could I make this SQL cached?</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks! team.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Dadior</div>
</body>
</html>