
本地库中的一个查询的计划,test01中有100万左右的数据,pg-13.3版本
explain (analyze on,verbose on) SELECT count(*) FROM test01 WHERE t = 'osdba';
QUERY PLAN
-------------------------------------------------------------------------------------------------------
----------------------------------
Aggregate (cost=4.45..4.46 rows=1 width=8) (actual time=30.218..30.220 rows=1 loops=1)
Output: count(*)
-> Index Only Scan using idx_test01_t on public.test01 (cost=0.42..4.44 rows=1 width=0) (actual ti
me=30.200..30.204 rows=2 loops=1)
Output: t
Index Cond: (test01.t = 'osdba'::text)
Heap Fetches: 0
Planning Time: 43.145 ms
Execution Time: 30.741 ms
plan时间>exec时间,这个如何理解??