# View Statistics

**URL:** <https://forums.percona.com/t/view-statistics/2937>\
**Category:** Other MySQL® Questions\
**Created:** [September 13, 2013, 3:21pm UTC](https://forums.percona.com/t/view-statistics/2937 "2013-09-13T15:21:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbgriffith](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jbgriffith/32/957_2.png) [@jbgriffith](https://forums.percona.com/u/jbgriffith)\
**Post date:** [September 13, 2013, 3:21pm UTC](https://forums.percona.com/t/view-statistics/2937/1 "2013-09-13T15:21:34Z")

</div>

Is there a way to enable statistics on Views? I haven’t found anything about it in the documentation (yet), and google returns well, a bunch of stuff related to querying the information\_schema about the stats and all the other stuff regarding statistics.

---

<div class="post-metadata">

**Author:** ![niljoshi](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/niljoshi/32/16889_2.png) [@niljoshi](https://forums.percona.com/u/niljoshi)\
**Post date:** [September 16, 2013, 2:55am UTC](https://forums.percona.com/t/view-statistics/2937/2 "2013-09-16T02:55:03Z")

</div>

Hi,

Which kind of statistics you want? Generally by default, all views related information, you can get in information\_schema.views table.  
mysql\> desc information\_schema.VIEWS;  
±---------------------±-------------±-----±----±--------±------+  
| Field | Type | Null | Key | Default | Extra |  
±---------------------±-------------±-----±----±--------±------+  
| TABLE\_CATALOG | varchar(512) | NO | | | |  
| TABLE\_SCHEMA | varchar(64) | NO | | | |  
| TABLE\_NAME | varchar(64) | NO | | | |  
| VIEW\_DEFINITION | longtext | NO | | NULL | |  
| CHECK\_OPTION | varchar(8) | NO | | | |  
| IS\_UPDATABLE | varchar(3) | NO | | | |  
| DEFINER | varchar(77) | NO | | | |  
| SECURITY\_TYPE | varchar(7) | NO | | | |  
| CHARACTER\_SET\_CLIENT | varchar(32) | NO | | | |  
| COLLATION\_CONNECTION | varchar(32) | NO | | | |  
±---------------------±-------------±-----±----±--------±------+  
10 rows in set (0.01 sec)

mysql\>

---

<div class="post-metadata">

**Author:** ![jbgriffith](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jbgriffith/32/957_2.png) [@jbgriffith](https://forums.percona.com/u/jbgriffith)\
**Post date:** [September 16, 2013, 9:52am UTC](https://forums.percona.com/t/view-statistics/2937/3 "2013-09-16T09:52:31Z")

</div>

I’m looking for usage statistics on views, similar to the statistics on tables that is shown in TABLE\_STATISTICS.

---

<div class="post-metadata">

**Author:** ![niljoshi](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/niljoshi/32/16889_2.png) [@niljoshi](https://forums.percona.com/u/niljoshi)\
**Post date:** [September 17, 2013, 1:11am UTC](https://forums.percona.com/t/view-statistics/2937/4 "2013-09-17T01:11:07Z")

</div>

Hi,

AFAIK, there is no any statistics table for views because they are not like physical tables but they are based on tables so you can check statistics of underlying tables of view.

---

<div class="post-metadata">

**Author:** ![jbgriffith](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jbgriffith/32/957_2.png) [@jbgriffith](https://forums.percona.com/u/jbgriffith)\
**Post date:** [September 17, 2013, 9:18am UTC](https://forums.percona.com/t/view-statistics/2937/5 "2013-09-17T09:18:21Z")

</div>

Yeah, I was afraid of that. The reason I am looking for that is our Dev team is renaming tables and want to make sure that they have made all the changes in the code and were hoping to see something like 0 queries against that view. Thanks.
