# MV\_QUERY\_PROSPECTIVE\_HISTOGRAMS

This view contains information about columns which were used in queries where a histogram could have been utilized, but did not have histograms.

This is similar to `MV_PROSPECTIVE_HISTOGRAMS`, but `MV_QUERY_PROSPECTIVE_HISTOGRAMS` displays one row per column per query, while `MV_PROSPECTIVE_HISTOGRAMS` displays one row per column, and aggregates over all queries.

This view counts over all queries (rows) in the in-memory plancache in order to distinguish which of these contain applicable columns. This can be useful for examining which columns included in these queries should have autostats enabled for the future. See further information about this, and how to set autostats in [Statistics and Sampling](https://docs.singlestore.com/db/v9.1/query-data/query-tuning/statistics-and-sampling.md).

| Column Name     | Description                                                                                                                                                        |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `ACTIVITY_NAME` | The`ID`of the query.                                                                                                                                               |
| `DATABASE_NAME` | The name of the related database.                                                                                                                                  |
| `TABLE_NAME`    | The name of the related table.                                                                                                                                     |
| `COLUMN_NAME`   | The name of a given column for which a prospective histogram has been identified.                                                                                  |
| `JSON_KEY`      | When there is a histogram on a json\_key as part of a json column, there's an entry here for each (column, json\_key) pair. For non-json columns`JSON_KEY`is NULL. |
| `USAGE_COUNT`   | The number of times the column was used where a histogram could have been utilized, counting once per occurrence of the table in the query.                        |

***

Modified at: January 5, 2024

Source: [/db/v9.1/reference/information-schema-reference/query-performance-workload-management-and-statistics/mv-query-prospective-histograms/](https://docs.singlestore.com/db/v9.1/reference/information-schema-reference/query-performance-workload-management-and-statistics/mv-query-prospective-histograms/)

(An index of the documentation is available at /llms.txt)
