isExplainAnalyzeOmni checks if an ExplainStmt has the ANALYZE option.
(n *ast.ExplainStmt)
| 122 | |
| 123 | // isExplainAnalyzeOmni checks if an ExplainStmt has the ANALYZE option. |
| 124 | func isExplainAnalyzeOmni(n *ast.ExplainStmt) bool { |
| 125 | if n.Options == nil { |
| 126 | return false |
| 127 | } |
| 128 | for _, item := range n.Options.Items { |
| 129 | if de, ok := item.(*ast.DefElem); ok { |
| 130 | if strings.EqualFold(de.Defname, "analyze") { |
| 131 | return true |
| 132 | } |
| 133 | } |
| 134 | } |
| 135 | return false |
| 136 | } |
| 137 | |
| 138 | // classifyExplainedQuery returns the QueryType for the query inside EXPLAIN ANALYZE. |
| 139 | func classifyExplainedQuery(query ast.Node) base.QueryType { |