文章目录
1.背景
gp的enable的enable_hashjoin 默认是on,可以用show enable_hashjoin查看,但是gp中hash join的优先级高于nested loop,会导致outter表的索引不生效
2.表结构
create table c_cs_e_deliver
(
id varchar(32) not null
primary key,
einvoice_code varchar(32),
einvoice_number varchar(32),
einvoice_name varchar(256),
agencyid_code varchar(32),
agency_code varchar(32)
)
create table c_cs_e_deliver_receiver
(
id varchar(32),
pid varchar(32),
ftype varchar(32),
fvalue varchar(256)
)
3. Nested loop vs Hash join
3.1 Hash join
3.1.1 适用场景
两表数据量均比较大