Currently we are selecting MAX(country), I think we need to order by date.
Description
Details
| Subject | Repo | Branch | Lines +/- | |
|---|---|---|---|---|
| Get missing country from latest donation | wikimedia/fundraising/tools | master | +54 -15 |
Related Objects
Event Timeline
Change #1236807 had a related patch set uploaded (by Ejegg; author: Ejegg):
[wikimedia/fundraising/tools@master] Get missing country from latest donation
Trying the timing of the query for the last couple weeks on staging, I get this for the old query: "59 rows in set (51.617 sec)", and this for the new one: "59 rows in set (1 min 5.344 sec)"
OK, the ungrouped 'INSERT / ON DUPLICATE KEY UPDATE no-op' seems to be a win - only 44 seconds for the select for the last two weeks on staging.
There was an even worse bug! The new test caught the fact that we weren't even consulting the country field that we've been backfilling from the contribution tracking. I've added a new COALESE() clause to get that in there.
That's fun. Confusing because we do coalesce when we insert into silverpop_export_staging, but I guess we need to do it again here with the dedupe factor.
Change #1236807 merged by jenkins-bot:
[wikimedia/fundraising/tools@master] Get missing country from latest donation