From deae3e9c371548c875b59713d814a3a4789d364a Mon Sep 17 00:00:00 2001 From: Waldo Jaquith Date: Tue, 9 Jan 2024 21:31:01 -0500 Subject: [PATCH] Nah, these queries aren't slow I just benchmarked them. I rewrote them as joins, and that wasn't faster, to my surprise. --- cron/partisanship.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cron/partisanship.php b/cron/partisanship.php index 8ceb267..9cc90e0 100644 --- a/cron/partisanship.php +++ b/cron/partisanship.php @@ -69,8 +69,6 @@ # Calculate the percentages of the legislators' party memberships who have cosponsored any bill # introduced by this legislator. - // Using this "IN" clause is just ridiculous. The query takes a good .2 seconds, which is way - // too long. There's got to be a faster way to do this. $sql = 'SELECT representatives.party, COUNT(*) AS number FROM bills_copatrons LEFT JOIN representatives @@ -113,8 +111,6 @@ # of bills copatroned by this legislator. Meaning, look at every bill that this legislator has # copatroned, and look at every other copatron of those bills, and calculate the percentage of # those copatrons that are Democrats, Republicans, and independents. - // Using this "IN" clause is just ridiculous. The query takes a good .1 seconds, which is way - // too long. There's got to be a faster way to do this. $sql = 'SELECT representatives.party, COUNT(*) AS number FROM bills_copatrons LEFT JOIN representatives