Re: On disable_cost
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Jian Guo <gjian@vmware.com>,
Zhenghua Lyu <zlyu@vmware.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-03-13T13:05:00Z
Lists: pgsql-hackers
On Tue, Mar 12, 2024 at 4:55 PM David Rowley <dgrowleyml@gmail.com> wrote: > The primary place I see issues with disabled_cost is caused by > STD_FUZZ_FACTOR. When you add 1.0e10 to a couple of modestly costly > paths, it makes them appear fuzzily the same in cases where one could > be significantly cheaper than the other. If we were to bump up the > disable_cost it would make this problem worse. Hmm, good point. > So maybe the fix could be to set disable_cost to something like > 1.0e110 and adjust compare_path_costs_fuzzily to not apply the > fuzz_factor for paths >= disable_cost. However, I wonder if that > risks the costs going infinite after a couple of cartesian joins. Yeah, I think the disabled flag is a better answer if we can make it work. No matter what value we pick for disable_cost, it's bound to skew the planning sometimes. -- Robert Haas EDB: http://www.enterprisedb.com
Commits
-
Doc: add detail about EXPLAIN's "Disabled" property
- 84b8fccbe5c2 18.0 landed
-
Adjust EXPLAIN's output for disabled nodes
- 161320b4b960 18.0 landed
-
Fix order of parameters in a cost_sort call
- 87b6c3c0b703 18.0 landed
-
Show number of disabled nodes in EXPLAIN ANALYZE output.
- c01743aa4866 18.0 landed
-
Treat number of disabled nodes in a path as a separate cost metric.
- e22253467942 18.0 landed
-
Remove grotty use of disable_cost for TID scan plans.
- e4326fbc60c4 18.0 landed