下载吧 - 绿色安全的游戏和软件下载中心

软件下载吧

当前位置:软件下载吧 > 技术开发 > 数据库 > PostgreSQL索引失效会发生什么

PostgreSQL索引失效会发生什么

时间:2024-02-14 10:20作者:下载吧人气:23

前段时间碰到个奇怪的索引失效的问题,实际情况类似下面这样:

bill=# begin;
BEGIN
bill=*# create index idx_t1 on t1(id);
CREATE INDEX
bill=*# explain select * from t1 where id = 1;
QUERY PLAN
—————————————————-
Seq Scan on t1 (cost=0.00..25.88 rows=6 width=36)
Filter: (id = 1)
(2 rows)

bill=*# end;
COMMIT
bill=# explain select * from t1 where id = 1;
QUERY PLAN
———————————————————————
Bitmap Heap Scan on t1 (cost=1.50..7.01 rows=6 width=36)
Recheck Cond: (id = 1)
-> Bitmap Index Scan on idx_t1 (cost=0.00..1.50 rows=6 width=0)
Index Cond: (id = 1)
(4 rows)

标签[db:关键字]

相关下载

查看所有评论+

网友评论

网友
您的评论需要经过审核才能显示

热门阅览

最新排行

公众号