-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change schedule_a default sort by contribution_receipt_date DESC (reminder Jul 20) #4402
Comments
Per @fec-jli I did the following research for your review Summary: 1)Probelem: the DESC soring is too expensive to our sites (Major performance bottleneck) i.e., it is fast enoughwithout "ORDER BY" sorting 4)for non-real pure sql, ASC index still has "Index Scan Backward" for DESC sorting but not in our complex sql (so index recreation is nessary but it needs more efforts Test 1 group (for "simple" one table one sql on sorting): 1.explain (select * from a1 order by pg_date desc limit 10) 2.explain (select * from a1 order by pg_date desc limit 10)
Test2 group: with real sql and indexes we have ----sorting by our real sqls Analysis: the DESC soring is too expensive (bottleneck). Sort (cost=31550196.55..31595998.39 rows=18320737 width=2967)" Sql: "Limit (cost=31550196.55..31550196.62 rows=30 width=2967)" ---without ORDER by super fast (so this is the bottleneck "Limit (cost=0.84..11.31 rows=3 width=2947)" ---use ASC in sql (not work "Limit (cost=31550196.55..31550196.62 rows=30 width=2967)" Solutions idea: ----1) add where filter 2019_2020 partitions, see #4414 "Limit (cost=1.43..278.82 rows=30 width=2931)" created an index (not work
----not use this index "Limit (cost=31337107.86..31337107.94 rows=30 width=3013)" |
The email to APIinfo@fec.gov: |
Currently for /schedules/schedule_a/ endpoint, the default sorting "contribution_receipt_date ASC and NULLS last". But SB and SE are sorted DESC by default. Website always has DESC by default for SA, SB and SE.
Completion criteria:
PI 12 Innovation sprint
: Send reminder email around July 19: Look for any new users who use contribution_receipt_date ASC or don't pass this sort.Sprint 13.1
: work on changing the sort default from ASC to DESC and check testThe text was updated successfully, but these errors were encountered: