By using EXPLAIN one can see the cost of running a query. The cost is in artificial units, and they are based on pre-defined parameters. 1 is one disk fetch and a CPU cycle is 0.01 units, I believe. My question is why PostgreSQL does not automatically run a test upon installation to determine the real numbers based on the hardware? Shouldn't this be an obvious quick win?
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
What you're referring to is known as System Statistics in Oracle; I don't think Postgres supports these (yet?).
It the costs were constant there might be a marginal gain. The units are necessarily artificial as the various resources are not interchangeable. Even on the same system the costs can vary at different times.
Once the database is created, it may be possible to determine better metrics from the database. Use of the updated metrics may change loads in ways than make them invalid. There are margins beyond which behavior becomes relatively un-predicable and likely to seriously degrade.