nerdexam
Oracle

1Z0-873 · Question #124

Index analysis and optimization using ANALYZE and OPTIMIZE statements should...

The correct answer is D. be run when EXPLAIN SELECT shows that an inordinate amount of rows is expected to be read. The ANALYZE TABLE statement updates a table with information about the distribution of key values in the table. This information is used by the optimizer to make better choices about query execution plans. This statement works for MyISAM and InnoDB tables. The OPTIMIZE TABLE…

Performance Optimization

Question

Index analysis and optimization using ANALYZE and OPTIMIZE statements should...

Options

  • Agenerally never be run manually
  • Bbe run once the table reaches 100,000 rows or above
  • Cbe run when more than 5% of the rows are changed by a single statement
  • Dbe run when EXPLAIN SELECT shows that an inordinate amount of rows is expected to be read
  • Ebe run when you suspect that a table is heavily fragmented

How the community answered

(42 responses)
  • A
    5% (2)
  • B
    2% (1)
  • C
    12% (5)
  • D
    79% (33)
  • E
    2% (1)

Explanation

The ANALYZE TABLE statement updates a table with information about the distribution of key values in the table. This information is used by the optimizer to make better choices about query execution plans. This statement works for MyISAM and InnoDB tables. The OPTIMIZE TABLE statement cleans up a MyISAM table by defragmenting it. This involves reclaiming unused space resulting from deletes and updates, and coalescing records that have become split and stored non-contiguously. OPTIMIZE TABLE also sorts the index pages if they are out of order and updates the index statistics.

Topics

#ANALYZE TABLE#OPTIMIZE TABLE#EXPLAIN SELECT#query optimization

Community Discussion

No community discussion yet for this question.

Full 1Z0-873 Practice