Jira (PDB-5042) Add option to execute queries with EXPLAIN ANALYZE to PuppetDBServer TK query method

19 views
Skip to first unread message

Zachary Kent (Jira)

unread,
Feb 22, 2021, 3:13:01 PM2/22/21
to puppe...@googlegroups.com
Zachary Kent created an issue
 
PuppetDB / New Feature PDB-5042
Add option to execute queries with EXPLAIN ANALYZE to PuppetDBServer TK query method
Issue Type: New Feature New Feature
Assignee: Unassigned
Created: 2021/02/22 12:12 PM
Priority: Normal Normal
Reporter: Zachary Kent

We want to be able to pass a flag to the TK PuppetDBServer query method which will cause a given query to be wrapped in an EXPLAIN (analyze, buffers, format json) block. See Postgres's explain docs for more details.

 You'll need to thread this option down from query -> stream-query-result -> query->sql -> compile-user-query->sql -> compile-query. In compile-query we'll need to add a way to concatenate the EXPLAIN command to the generated query.

 

Doing this will enable future performance testing work and will allow us to enable outside users to get the EXPLAIN ANALYZE results of a query without needing to log into a psql prompt after recreating the SQL that PDB generated. 

 

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

Zachary Kent (Jira)

unread,
Feb 22, 2021, 3:16:02 PM2/22/21
to puppe...@googlegroups.com
Zachary Kent updated an issue
Change By: Zachary Kent
Acceptance Criteria: * PuppetDBServer TK query method has flag which will run a query wrapped in an EXPLAIN call and return the results in JSON format.
* A test which checks that the query method works as expected. This test can be internal and call the PuppetDBServer directly. 

Zachary Kent (Jira)

unread,
Feb 22, 2021, 5:32:02 PM2/22/21
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Feb 23, 2021, 8:09:03 AM2/23/21
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Feb 24, 2021, 10:00:05 AM2/24/21
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Feb 24, 2021, 10:05:00 AM2/24/21
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Feb 24, 2021, 10:05:03 AM2/24/21
to puppe...@googlegroups.com

Oana Tanasoiu (Jira)

unread,
Feb 25, 2021, 2:07:04 AM2/25/21
to puppe...@googlegroups.com

Oana Tanasoiu (Jira)

unread,
Mar 1, 2021, 6:50:01 AM3/1/21
to puppe...@googlegroups.com
Oana Tanasoiu assigned an issue to Unassigned

Zachary Kent (Jira)

unread,
Mar 1, 2021, 3:10:01 PM3/1/21
to puppe...@googlegroups.com
Zachary Kent commented on New Feature PDB-5042
 
Re: Add option to execute queries with EXPLAIN ANALYZE to PuppetDBServer TK query method

Sorry, just saw your comment. For now we should see if we can return the result using the streaming that regular queries use. If we have the EXPLAIN output format set to JSON we might be able to stream it back to the caller without needing changes. If that's the case having a tests which looks at the explain result and asserts something about the explain format is sufficient. If we require changes to the streaming to account for the EXPLAIN ANALYZE output we can document the errors here and either attempt to address them or create a new ticket. 

Oana Tanasoiu (Jira)

unread,
Mar 2, 2021, 7:43:56 PM3/2/21
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

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

Zachary Kent (Jira)

unread,
Apr 9, 2021, 5:12:03 PM4/9/21
to puppe...@googlegroups.com
Zachary Kent updated an issue
Change By: Zachary Kent
Fix Version/s: PDB n/a
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Claudia Petty (Jira)

unread,
Jun 21, 2023, 10:57:04 AM6/21/23
to puppe...@googlegroups.com
Claudia Petty updated an issue
Change By: Claudia Petty
Labels: new-feature tsr-pdb-backlog
This message was sent by Atlassian Jira (v8.20.21#820021-sha1:38274c8)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages