|
|
|
|
|
by maweki
2323 days ago
|
|
> No, that's not how a left join works. It's how a naive implementation would work. Nobody actually knows "how" this left join works since we don't know what the query planner will do. Manifesting a whole outer join is not totally unreasonable in all cases. I think you come off as very aggressive and there's no need for that tone. But I do agree with the sentiment that the query might not be bad. |
|
The where clause at the end will filter to the desired rows. The left join will do absolutely nothing bad.
The purpose of the left join is to include voters who might not be assigned to a precinct.
It's a perfectly fine and performant query.
Outputting the query also doesn't really make any difference. Despite what the people on Twitter are saying showing the query does not make SQL injection easier or harder, it's irrelevant.
The big problem with the query is the lack of bound parameters. It's possible to do that safely in theory, but in practice it's not a good idea.