Jira (PDB-5055) Add a new query param that returns EXPLAIN ANALYZE output for a given query

16 views
Skip to first unread message

Zachary Kent (Jira)

unread,
Mar 4, 2021, 5:30:01 PM3/4/21
to puppe...@googlegroups.com
Zachary Kent created an issue
 
PuppetDB / Bug PDB-5055
Add a new query param that returns EXPLAIN ANALYZE output for a given query
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2021/03/04 2:29 PM
Priority: Normal Normal
Reporter: Zachary Kent

We want to expose the EXPLAIN ANALYZE option added to the TK PuppetDBServer query method in PDB-5042 externally via a query param.

To add the query param we could follow the example in the initial drop-joins pr. This pr added a optimize_drop_unused_joins=true query parameter to allow clients to opt-in to drop-joins. Following a similar pattern should allow us to pass down a flag which should eventually hit the same path used in PDB-5042 which will return the JSON of an EXPLAIN ANALYZE for a given query.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Zachary Kent (Jira)

unread,
Mar 4, 2021, 5:32:01 PM3/4/21
to puppe...@googlegroups.com
Zachary Kent updated an issue
Change By: Zachary Kent
Acceptance Criteria: * New query param which causes any query to return EXPLAIN ANALYZE output
* Tests which check that this param works across a handful of the query endpoints
* Documentation explaining the new query param

Zachary Kent (Jira)

unread,
Mar 4, 2021, 5:33:01 PM3/4/21
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Mar 10, 2021, 9:24:02 AM3/10/21
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Mar 10, 2021, 9:24:03 AM3/10/21
to puppe...@googlegroups.com

Oana Tanasoiu (Jira)

unread,
Mar 11, 2021, 12:08:03 PM3/11/21
to puppe...@googlegroups.com

Rob Browning (Jira)

unread,
Mar 23, 2021, 6:07:03 PM3/23/21
to puppe...@googlegroups.com
Rob Browning commented on Bug PDB-5055
 
Re: Add a new query param that returns EXPLAIN ANALYZE output for a given query

After some discussion with Austin, we'd like to suggest some API changes. In particular, perhaps change the :explain?` parameter to :explain which would match the existing pretty, side-steps any questions about whether we'd want a question-mark in the query parameter name, or would need to change the name "on the way in", and also leave a convenient opening for future enhancements.

In particular, we were thinking that perhaps this first version might only allow :explain :analyze rather than :explain true, under the argument that we might eventually want to allow other options, maybe like this:

  https://...?explain=analyze
  https://...?explain=analyze,no_verbose,no_buffers
  https://...?explain=no_analyze

We might also process the comma-separated options from left to right so that later selections override earlier ones (which can be handy when programmatically generating queries:

  https://...?explain=analyze,no_verbose,buffers,verbose

But we don't need any of that extended syntax for now (if ever). For now, we were thinking we might just implement explain=analyze (and internally :explain :analyze) and leave anything else for a hypothetical future.

Rob Browning (Jira)

unread,
Mar 23, 2021, 6:10:03 PM3/23/21
to puppe...@googlegroups.com
Rob Browning commented on Bug PDB-5055

We might also consider adding a code comment somewhere reasonable (perhaps in or around one of the more relevant functions) describing the hypothetical plan so anyone who comes along to make adjustments later can consider it.

Bogdan Irimie (Jira)

unread,
Mar 24, 2021, 10:09:03 AM3/24/21
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Sprint: ghost-24.03.2021 , ready for triage 3

Bogdan Irimie (Jira)

unread,
Apr 7, 2021, 9:04:03 AM4/7/21
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Sprint: ghost-24.03.2021, ghost-7.04.2021 , HAHA/Grooming 2
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Zachary Kent (Jira)

unread,
Apr 9, 2021, 5:08:02 PM4/9/21
to puppe...@googlegroups.com
Zachary Kent updated an issue
Change By: Zachary Kent
Fix Version/s: PDB 7.3.0
Fix Version/s: PDB 6.16.0
Reply all
Reply to author
Forward
0 new messages