[pgpool-general-jp: 482] pgpool-II-2.1: パラレルクエリ

sho sho @ big.or.jp
2008年 8月 14日 (木) 14:17:04 JST


こんにちは、sho と申します。

pgpool-II 2.1: パラレルクエリで sql の実行に失敗します。

* OK な SQL
select * from t2 inner join t1 using(id1);

* NG な SQL その1
select * from t2 inner join t1 on t1.id1=t2.id1;
--> 実行はされるが、結果が正しくない
    LOG:
    is_parallel_query: query is done by loadbalance
    SimpleQuery: loadbalance_query =select * from t2 inner join t1 on t1.id1=t2.id1;

    たぶん、以下の is_loadbalance = true の影響だと思うんですが...
    pool_rewrite_outfuncs.c: _rewriteColumnRef()
                if(!DetectValidColumn(message,table_name,column_name,message->current_select,-1))
                {
                        message->is_loadbalance = true;

* NG な SQL その2
select t1.name1,t2.name2 from t2 inner join t1 using(id1);
ERROR:  column "pool_c$0" does not exist
--> 結合条件などに含まれないカラムを指定して出力しようとするとエラーとなる


以上、よろしくお願いします。

━━━ 以下に設定情報
* 環境
  Server A: CentOS 4.6 + pgpool-II 2.1

  Server B: nodedb-0 : PostgreSQL 8.2.5
  Server C: nodedb-1 : PostgreSQL 8.2.5
  Server C: nodedb-2 : PostgreSQL 8.2.5

* table 定義
create table t1 (
  id1   integer,
  name1 text,
  flg   smallint,
  primary key (id1)
);
create table t2 (
  id1   integer,
  id2   integer,
  name2 text,
  memo  text,
  primary key (id1,id2)
);

* データ分割ルール
INSERT INTO pgpool_catalog.dist_def VALUES ('pgtest000','public','t1','id1',
    ARRAY['id1','name1','flg'],
    ARRAY['integer','text','smallint'],
    'pgpool_catalog.pgtest000f0'
);
INSERT INTO pgpool_catalog.dist_def VALUES ('pgtest000','public','t2','id1',
    ARRAY['id1','id2','name2','memo'],
    ARRAY['integer','integer','text','text'],
    'pgpool_catalog.pgtest000f1'
);

* 分散関数
CREATE OR REPLACE FUNCTION pgpool_catalog.pgtest000f0(anyelement)
RETURNS integer AS $$
    SELECT $1 % 2;
$$ LANGUAGE sql;
CREATE OR REPLACE FUNCTION pgpool_catalog.pgtest000f1(anyelement)
RETURNS integer AS $$
    SELECT $1 % 2 + 1;
$$ LANGUAGE sql;

-- sho


pgpool-general-jp メーリングリストの案内