> The other serious error we could be making here is to change things on >> the basis of just a few examples. You really need a pretty wide range >> of test cases to be sure that you're not making things worse, any time >> you're twiddling basic parameters like these. >> >> > I will try more thing with this direction, thanks for suggestion. >
I choose TPC-H for this purpose and the data and index setup based on [1], the attached normal.log is the plan without this patch, and patched.log is the plan with the patch. In general, the best path doesn't change due to this patch, All the plans whose cost changed has the following patten, which is expected. Index Scan ... Index Cond: ... Filter: ... If you diff the two file, you may find the cost of "Index Scan" doesn't change, that is mainly because it only show 2 digits in cost, which is not accurate enough to show the difference. However with a nest loop, the overall plan shows the cost difference. [1] https://ankane.org/tpc-h -- Best Regards Andy Fan
normal.log
Description: Binary data
patched.log
Description: Binary data