planner switch from index scan to seq scan?

Started by Bob Parkinsonover 25 years ago2 messagesgeneral
Jump to latest
#1Bob Parkinson
rwp@biome.ac.uk

Is there are simple rule for when the planner switches over from doing an
index scan to a seq scan?

Cheers,

Bob

Bob Parkinson
rwp@biome.ac.uk
------------------------------------------------------------------
Technical Manager: Biome http://biome.ac.uk/

Greenfield Medical Library,
Queens Medical Centre,
Nottingham. 0115 9249924 x 42059
------------------------------------------------------------------
We are stardust

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bob Parkinson (#1)
Re: planner switch from index scan to seq scan?

Bob Parkinson <rwp@biome.ac.uk> writes:

Is there are simple rule for when the planner switches over from doing an
index scan to a seq scan?

Sure: when it thinks the seqscan is cheaper ;-)

The cost models on which this is based are not so simple, but you
can study them if you like, see src/backend/optimizer/path/costsize.c

regards, tom lane