-
Notifications
You must be signed in to change notification settings - Fork 1.8k
CodeQL documentation: reorganize 'Advanced QL' topics #2583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is a sensible restructuring! Just a few minor comments, otherwise LGTM.
|
||
Going from ``Element -> File`` and ``Element -> Location -> StartLine`` is linear--that is, there is only one ``File``, ``Location``, etc. for each ``Element``. | ||
|
||
However, as written it is difficult for the optimizer to pick out the best ordering. Generally, we want to do the quick, linear parts first, and then join on the resultant larger tables. Joining first and then doing the linear lookups later would likely result in poor performance. We can initiate this kind of ordering by splitting the above predicate as follows: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... would likely result in poor performance. We can initiate this kind of ordering ...
Sounds like we want to initiate the "bad" ordering! Perhaps swap the order of the two preceding sentences.
.. code-block:: ql | ||
|
||
predicate similar(Element e1, Element e2) { | ||
e1.getName() = e2.getName() and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first half of this topic uses the "autoformatted" style, in particular 2 spaces for indentation instead of 4. Probably worth doing that here too.
(I wouldn't worry about it in the older standalone topics, but the difference is quite noticeable here.)
Thanks @shati-patel. I've addressed both of your comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 👍
Another mini suggestion, but I'm happy to merge as-is too.
Co-Authored-By: shati-patel <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
I have now (rather belatedly) added redirects for the topics that were removed in this PR. |
The topics that currently live under Advanced QL in the 'Learning CodeQL' Sphinx project are a bit random. I've started to move them around into (hopefully) more logical/helpful locations:
@max-schaefer would you mind reviewing the technical aspect of these changes please?
@shati-patel do you agree with this restructuring? (and please can you review the text?)
TODO