- Notifications
You must be signed in to change notification settings - Fork5
Commit05e27a9
committed
Remove LEFT part of JOIN to pg_roles because of optimizer limitation:
> True, but they're not being used where you'd expect. This seems to be> something to do with the fact that it's not pg_authid which is being> accessed, but rather the view pg_roles.I looked into this and it seems the problem is that the view doesn'tget flattened into the main query because of the has_nullable_targetlistlimitation in prepjointree.c. That's triggered because pg_roles has '********'::text AS rolpasswordwhich isn't nullable, meaning it would produce wrong behavior ifreferenced above the outer join.Ultimately, the reason this is a problem is that the planner deals onlyin simple Vars while processing joins; it doesn't want to think aboutexpressions. I'm starting to think that it may be time to fix this,because I've run into several related restrictions lately, but it seemslike a nontrivial project.In the meantime, reducing the LEFT JOIN to pg_roles to a JOIN as perPeter's suggestion seems like the best short-term workaround.1 parent7d57a18 commit05e27a9
1 file changed
+5
-5
lines changedLines changed: 5 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
6 |
| - | |
| 6 | + | |
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
| |||
194 | 194 |
| |
195 | 195 |
| |
196 | 196 |
| |
197 |
| - | |
| 197 | + | |
198 | 198 |
| |
199 | 199 |
| |
200 | 200 |
| |
| |||
367 | 367 |
| |
368 | 368 |
| |
369 | 369 |
| |
370 |
| - | |
| 370 | + | |
371 | 371 |
| |
372 | 372 |
| |
373 | 373 |
| |
| |||
1485 | 1485 |
| |
1486 | 1486 |
| |
1487 | 1487 |
| |
1488 |
| - | |
| 1488 | + | |
1489 | 1489 |
| |
1490 | 1490 |
| |
1491 | 1491 |
| |
| |||
1727 | 1727 |
| |
1728 | 1728 |
| |
1729 | 1729 |
| |
1730 |
| - | |
| 1730 | + | |
1731 | 1731 |
| |
1732 | 1732 |
| |
1733 | 1733 |
| |
|
0 commit comments
Comments
(0)