Conversation
Previously the optimizer was, in some cases, making a table of the file corresponding to all locations and only then limiting to locations corresponding to diagnostics. This pragma forces it to start from a list of diagnostics, get the locations and then the files.
There was a problem hiding this comment.
Pull request overview
Updates Go extractor diagnostic reporting to steer the QL optimizer toward a more efficient join order when deriving the associated file for a diagnostic, avoiding large intermediate tables.
Changes:
- Add
pragma[only_bind_into](this)when computingDiagnostic.getFile()to drive evaluation from diagnostics → locations → files.
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
|
I think you're right. We want to enforce that the location is bound before we get the corresponding file, which is what your suggestiong does. I always find these pragmas confusing. For the record the original RA was: With your suggestion the RA is: |
|
Woah! It's recursive?! |
|
I don't understand that either. Here are the relevant parts of the RA: If I'm reading that correctly it's recursive with |
|
But the presumably "bad" join-order doesn't actually look that bad to me - was it taking non-trivial time to compute somewhere? Because otherwise I don't think there's anything to fix here. |
|
No, it wasn't taking up any time. It was just showing up in the nightly DCA runs and seemed like an easy fix. |
|
Ah! It's being turned into a recursive predicate through magic that's inserted on |
|
I just tried it out and just adding that pragma doesn't get rid of the problem. |
|
Which predicate did you target? The following does the trick for me: |
Previously the optimizer was, in some cases, making a table of the file corresponding to all locations and only then limiting to locations corresponding to diagnostics. This pragma forces it to start from a list of diagnostics, get the locations and then the files.