Partition Tid Scan¶
名称¶
Tid扫描算子
举例¶
--清理环境
DROP TABLE t1;
--创建分区表
CREATE TABLE t1(a int,b int)
PARTITION BY HASH(a, b) PARTITIONS 2;
INSERT INTO t1 SELECT generate_series(1,20),generate_series(21,40);
ANALYZE t1;
--创建游标
DECLARE c1 SCROLL CURSOR FOR SELECT * FROM t1;
OPEN c1;
FETCH from c1;
EXPLAIN ANALYZE DELETE FROM t1 WHERE CURRENT OF c1;
QUERY PLAN
------------------------------------------------------------------------------------------------------
Partition Tid Scan on T1 (cost=0.00..1.01 rows=1 width=16) (actual time=0.01..0.01 rows=1 loops=1)
Filter: (("ROWID" = 17410::bigint) AND (SYSATTR_SEGMENTID = 17088::bigint))
Planning Time: 0.20 msec
Execution Time: 0.18 msec
(4 rows)
CLOSE c1;
--清理环境
DEALLOCATE c1;
DROP TABLE t1 CASCADE;
- on T1 算子属性,表示Tid扫描的分区表
- Filter 限定条件