You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<FunctionDescriptiondescription="Introduced or updated: v1.2.647"/>
8
8
9
-
`EXPLAIN ANALYZE GRAPHICAL`used to open a browser page to display a query execution plan along with actual run-time performance statistics.
9
+
`EXPLAIN ANALYZE GRAPHICAL`is a command available exclusively in the BendSQL client. It allows you to analyze the performance and execution plan of a SQL query by automatically launching your default browser and presenting an interactive visual representation of the query execution process.
10
10
11
-
This is useful for analyzing query performance and identifying bottlenecks in a query.
12
-
13
-
**Note:** This feature is available only in BendSQL.
11
+
This command is supported only in BendSQL v0.22.2 and above. Before using it, ensure that your BendSQL is properly configured. For setup instructions, see [Configuring BendSQL](#configuring-bendsql).
14
12
15
13
## Syntax
16
14
17
15
```sql
18
16
EXPLAIN ANALYZE GRAPHICAL <statement>
19
17
```
20
18
19
+
## Configuring BendSQL
20
+
21
+
To enable graphical analysis and automatically open your default browser, add the following section to your BendSQL configuration file `~/.config/bendsql/config.toml`:
22
+
23
+
```toml
24
+
[server]
25
+
bind_address = "127.0.0.1"
26
+
auto_open_browser = true
27
+
```
28
+
21
29
## Examples
22
30
23
-
TPC-H Q21:
31
+
You can use `EXPLAIN ANALYZE GRAPHICAL` to analyze the performance of complex queries, such as TPC-H benchmark queries, and understand how each part of the query contributes to overall execution time.
24
32
25
-
```sql
26
-
EXPLAIN ANALYZE GRAPHICAL SELECT s_name,
27
-
->Count(*) AS numwait
28
-
->FROM supplier,
29
-
-> lineitem l1,
30
-
-> orders,
31
-
-> nation
32
-
->WHERE s_suppkey =l1.l_suppkey
33
-
->AND o_orderkey =l1.l_orderkey
34
-
->AND o_orderstatus ='F'
35
-
->ANDl1.l_receiptdate>l1.l_commitdate
36
-
->AND EXISTS (SELECT*
37
-
->FROM lineitem l2
38
-
->WHEREl2.l_orderkey=l1.l_orderkey
39
-
->ANDl2.l_suppkey<>l1.l_suppkey)
40
-
->AND NOT EXISTS (SELECT*
41
-
->FROM lineitem l3
42
-
->WHEREl3.l_orderkey=l1.l_orderkey
43
-
->ANDl3.l_suppkey<>l1.l_suppkey
44
-
->ANDl3.l_receiptdate>l3.l_commitdate)
45
-
->AND s_nationkey = n_nationkey
46
-
->AND n_name ='EGYPT'
47
-
-> GROUP BY s_name
48
-
-> ORDER BY numwait DESC,
49
-
-> s_name
50
-
->LIMIT100;
51
-
52
-
// will open a browser page to display the query execution plan and performance statistics.
33
+
Here is an example query that calculates aggregates from the `lineitem` table:
1095 rows graphical in 21.762 sec. Processed 0 rows, 0 B (0 row/s, 0 B/s)
65
+
```
66
+
67
+
This automatically opens your default browser and shows an interactive graphical view of the query execution plan, including operator runtimes, row counts, and data flow between stages.
0 commit comments