Snapshot of a query's state, archived in the query log. Not mutated after construction. Please update EstimateSize() if field member changed.
| 34 | /// Snapshot of a query's state, archived in the query log. Not mutated after |
| 35 | /// construction. Please update EstimateSize() if field member changed. |
| 36 | struct QueryStateRecord { |
| 37 | /// Compressed representation of profile returned by RuntimeProfile::Compress(). |
| 38 | /// Must be initialised to a valid value if this is a completed query. |
| 39 | /// Empty if this was initialised from a running query. |
| 40 | const std::vector<uint8_t> compressed_profile; |
| 41 | |
| 42 | /// Query id |
| 43 | TUniqueId id; |
| 44 | |
| 45 | /// Queries are run and authorized on behalf of the effective_user. |
| 46 | /// If there is no delegated user, this will be the connected user. Otherwise, it |
| 47 | /// will be set to the delegated user. |
| 48 | std::string effective_user; |
| 49 | |
| 50 | /// If true, effective_user has access to the runtime profile and execution |
| 51 | /// summary. |
| 52 | bool user_has_profile_access; |
| 53 | |
| 54 | /// default db for this query |
| 55 | std::string default_db; |
| 56 | |
| 57 | /// SQL statement text |
| 58 | std::string stmt; |
| 59 | |
| 60 | /// Text representation of plan |
| 61 | std::string plan; |
| 62 | |
| 63 | /// DDL, DML etc. |
| 64 | TStmtType::type stmt_type; |
| 65 | |
| 66 | /// True if the query required a coordinator fragment |
| 67 | bool has_coord; |
| 68 | |
| 69 | /// The number of scan ranges that have completed. |
| 70 | int64_t num_completed_scan_ranges; |
| 71 | |
| 72 | /// The total number of scan ranges. |
| 73 | int64_t total_scan_ranges; |
| 74 | |
| 75 | /// The number of fragment instances that have completed. |
| 76 | int64_t num_completed_fragment_instances; |
| 77 | |
| 78 | /// The total number of fragment instances. |
| 79 | int64_t total_fragment_instances; |
| 80 | |
| 81 | /// The number of rows fetched by the client |
| 82 | int64_t num_rows_fetched; |
| 83 | |
| 84 | /// Total time spent returning rows to the client and other client-side processing. |
| 85 | int64_t client_fetch_wait_time_ns; |
| 86 | |
| 87 | /// The state of the query as of this snapshot. The possible values for the |
| 88 | /// query_state = union(beeswax::QueryState, ClientRequestState::RetryState). This is |
| 89 | /// necessary so that the query_state can accurately reflect if a query has been |
| 90 | /// retried or not. This string is not displayed in the runtime profiles, it is only |
| 91 | /// displayed on the /queries endpoint of the Web UI when listing out the state of |
| 92 | /// each query. This is necessary so that users can clearly see if a query has been |
| 93 | /// retried or not. |