Ken Tanzer <ken.tanzer@xxxxxxxxx> writes: > Hi. I'm wondering if this is normal or at least known behavior? > Basically, if I'm specifying a LIMIT and also NULLS FIRST (or NULLS LAST > with a descending sort), I get a sequence scan and a couple of orders of > magnitude slower query. Perhaps not relevantly, but definitely ironically, > the sort field in question is defined to be NOT NULL. The index won't get credit for matching the requested ordering if it's got the wrong null-ordering polarity. There's not an exception for NOT NULL columns. If you know the column hasn't got nulls, why are you bothering with a nondefault null-ordering request? regards, tom lane