Why does Postgresql use a Seq Scan on the first column of the PK?
0
votes
0
answers
52
views
This is my table:
CREATE TABLE IF NOT EXISTS public.ob_samples_sc5555 (
stamp timestamp(6) with time zone NOT NULL,
oblvl smallint NOT NULL,
olots integer NOT NULL,
CONSTRAINT prk_ob_samples_sc5555 PRIMARY KEY (stamp, oblvl)
);
This is my query:
delete from ob_samples_sc5555
where stamp Finalize Aggregate (cost=10106164.53..10106164.54 rows=1 width=8)
>
> -> Gather (cost=10106163.59..10106164.50 rows=9 width=8)
> Workers Planned: 9
> -> Partial Aggregate (cost=10105163.59..10105163.60 rows=1 width=8)
> -> Parallel Seq Scan on ob_samples_sc5555 (cost=0.00..9917330.49 rows=75133240 width=0)
> Filter: (stamp JIT:
> Functions: 6
> Options: Inlining true, Optimization true, Expressions true, Deforming true
Why does PG13 use a seq scan instead of primary key, while the column
stamp
is the first column of the PK?
Asked by Leon
(411 rep)
Feb 20, 2025, 01:20 AM