【发布时间】:2022-01-19 05:19:20
【问题描述】:
我在 ny select 查询上有一个限制为 1000 的查询更新:
UPDATE id SET satus = 201 WHERE uniquecode in (ids..)
我已经有我的查询的索引,但花了很长时间
CREATE UNIQUE INDEX id_idx ON public.id USING btree (id);
-> Index Scan using id_idx on id (cost=0.56..4280.29 rows=500 width=811) (actual time=0.758..11.244 rows=500 loops=1)
Index Cond: ((id)::numeric = ANY (ids..)
Planning Time: 3.087 ms
Execution Time: 1543.567 ms
我需要在 1000 毫秒以下执行
【问题讨论】:
标签: postgresql indexing