forked from JasperFx/marten
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exposing all EXPLAIN options. Quoting PG documentation in XML docs, s…
…o included PG license in repo. Not all parameters exposed in JSON deserialization, as they need to be dug out from explain.c in PG backend https://github.com/postgres/postgres/blob/18ce3a4ab22d2984f8540ab480979c851dae5338/src/backend/commands/explain.c (GitHub mirror)
- Loading branch information
1 parent
9dd0917
commit b7d81ea
Showing
9 changed files
with
199 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
PostgreSQL is released under the PostgreSQL License, a liberal Open Source license, similar to the BSD or MIT licenses. | ||
|
||
PostgreSQL Database Management System | ||
(formerly known as Postgres, then as Postgres95) | ||
|
||
Portions Copyright (c) 1996-2017, The PostgreSQL Global Development Group | ||
|
||
Portions Copyright (c) 1994, The Regents of the University of California | ||
|
||
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies. | ||
|
||
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System.Text; | ||
|
||
namespace Marten.Linq | ||
{ | ||
internal sealed class ConfigureExplainExpressions : IConfigureExplainExpressions | ||
{ | ||
private readonly StringBuilder toOptions = new StringBuilder(); | ||
public IConfigureExplainExpressions Analyze() | ||
{ | ||
toOptions.Append("ANALYZE,"); | ||
return this; | ||
} | ||
|
||
public IConfigureExplainExpressions Verbose() | ||
{ | ||
toOptions.Append("VERBOSE,"); | ||
return this; | ||
} | ||
|
||
public IConfigureExplainExpressions Costs() | ||
{ | ||
toOptions.Append("COSTS,"); | ||
return this; | ||
} | ||
|
||
public IConfigureExplainExpressions Buffers() | ||
{ | ||
toOptions.Append("BUFFERS,"); | ||
return this; | ||
} | ||
|
||
public IConfigureExplainExpressions Timing() | ||
{ | ||
toOptions.Append("TIMING,"); | ||
return this; | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return toOptions.ToString(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
namespace Marten.Linq | ||
{ | ||
public interface IConfigureExplainExpressions | ||
{ | ||
// Borrowing from PG 9.6 documentation https://www.postgresql.org/docs/9.2/static/sql-explain.html | ||
|
||
/// <summary> | ||
/// Carry out the command and show actual run times and other statistics. | ||
/// </summary> | ||
IConfigureExplainExpressions Analyze(); | ||
|
||
/// <summary> | ||
/// Display additional information regarding the plan. Specifically, include the output column list for each node in the plan tree, schema-qualify table and function names, always label variables in expressions with their range table alias, and always print the name of each trigger for which statistics are displayed. | ||
/// </summary> | ||
IConfigureExplainExpressions Verbose(); | ||
|
||
/// <summary> | ||
/// Include information on the estimated startup and total cost of each plan node, as well as the estimated number of rows and the estimated width of each row. | ||
/// </summary> | ||
IConfigureExplainExpressions Costs(); | ||
|
||
/// <summary> | ||
/// Include information on buffer usage. Specifically, include the number of shared blocks hit, read, dirtied, and written, the number of local blocks hit, read, dirtied, and written, and the number of temp blocks read and written. | ||
/// </summary> | ||
IConfigureExplainExpressions Buffers(); | ||
|
||
/// <summary> | ||
/// Include the actual startup time and time spent in the node in the output. | ||
/// </summary> | ||
IConfigureExplainExpressions Timing(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters