~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to docs/analyze.rst

  • Committer: Lee Bieber
  • Date: 2011-02-23 05:05:43 UTC
  • mfrom: (2193.1.2 build)
  • Revision ID: kalebral@gmail.com-20110223050543-w0nhgf512s0137mm
Merge Andrew - 723389: ORDER BY on sys_replication_log table causes InnoDB crash
Merge Marisa - documentation updates

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
ANALYZE
2
2
=======
3
3
 
4
 
ANALYZE TABLE table_name [, table_name] ...
5
 
 
6
 
ANALYZE TABLE read locks a table, and then analyzes and stores the key distribution for a table.
7
 
 
8
 
.. todo::
9
 
 
10
 
   is read lock always true?
11
 
 
12
 
.. todo::
13
 
   
14
 
   some engines don't perform an explicit gathering of statistics when
15
 
   you type ANALYZE. e.g. innobase (which only copies it's current estimate).
16
 
   Only recently did I add this to HailDB so that it does go and do the index
17
 
   dives on ANALYZE.
 
4
Syntax: ::
 
5
 
 
6
        ANALYZE TABLE table_name [, table_name] ...
 
7
 
 
8
ANALYZE TABLE usually read locks a table, and then analyzes and stores the key distribution for a table.
 
9
 
 
10
ANALYZE functionality differs depending on the storage engine.
 
11
 
 
12
On InnoDB tables, using ANALYZE will result in a WRITE LOCK on the table. It also will not perform an explicit gathering of statistics when
 
13
you issue an ANALYZE command. To update the index cardinality, there will be 10 random dives into each index, retrieving an estimated cardinality. Therefore, several ANALYZE TABLEs in a row are likely to produce different results each time.
 
14
 
 
15
Statistics-gathering with ANALYZE has recently been added to HailDB so that index dives are performed.