News for hackers. Stuff that matters.
Re:Ten years of improvements in PostgreSQL's optimizer by Sesse__ on Wednesday April 17, 2024 @11:28AM (#40066088)
No, it optimizes cost, which includes pages read from disk _and_ things like CPU use. Cost is an arbitrary unit meant to correlate with time spent, not by disk loads, so it's completely reasonable to compare plans with everything loaded in RAM. (Cost is by convention scaled such that one page read from disk is 1.0, but that's a different things from “the optimizer will try to minimize the number of pages read from disk”. It could just as well have been scaled so that 1.0 was 1 ms on some arbitrary machine.)

There are no comments on this comment yet.