我使用ApachePhoenix驱动程序(v4.13.1)运行了一个包含两个联接的简单查询:
explain
select one.pk, two.pk, three.pk
from table_one one
left join table_two two on two.pk = one.two_id
left join table_three three on three.pk = two.three_id .
where one.pk = 1
结果看起来很糟糕:
CLIENT 1-CHUNK 1 ROWS 384 BYTES PARALLEL 1-WAY ROUND ROBIN POINT LOOKUP ON 1 KEY OVER table_one
PARALLEL LEFT-JOIN TABLE 0
CLIENT 1-CHUNK PARALLEL 1-WAY ROUND ROBIN FULL SCAN OVER table_two
PARALLEL LEFT-JOIN TABLE 1(DELAYED EVALUATION)
CLIENT 1-CHUNK PARALLEL 1-WAY ROUND ROBIN FULL SCAN OVER table_three
SERVER FILTER BY FIRST KEY ONLY
注意,根据计划表2和表3上的联接将是完全扫描,即使联接是由rowkey进行的。
我希望能进行范围扫描,或者至少不是完全扫描。我对这个计划理解正确吗?完全扫描真的会被执行吗?
暂无答案!
目前还没有任何答案,快来回答吧!