Let an app opt out of row estimate hints - #2921
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe change adds the ChangesPer-app row hint control
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Feature Suggested reviewers: Merge Risk: ⚪ Minimal · up to The per-app row-hint control is wired through compatible UUID flag parsing and the updated caller; no actionable merge risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Row estimate hints (#2755) tell Postgres how many rows a join returns. For some apps they flip the next join the wrong way around. Postgres estimates the unparameterized scan of an attribute at 1 row, so once a hint says the driving CTE has 20 rows, it scans every triple of the attribute and filters each one against the CTE, instead of doing 20 index lookups.
One prod plan (app 6f4b4047, hinted
Rows(... #20)):I ran 97 of the top queries by database time through
instaql/explainin prod, with and without row hints:$inof 422 queries were at least 1.5x faster without row hints, 2 were slower (130 ms to 204 ms, and 14 ms to 21 ms), and the rest did not change.
disable-row-hints-query-hashesalready fixes a single query, and the verified hashes are listed there now. It does not scale for apps like 6f4b4047, where nearly every query is affected and the hash changes with the length of each$inlist. This addsdisable-row-hints-apps, a list of app ids that skip row hints. Everything else about their hints stays the same, and other apps are untouched.🤖 Generated with Claude Code