MySQL

The world's most popular open source database

Contact a MySQL Representative


  • MySQL.com
  • Developer Zone
  • Partners & Solutions
  • Customer Login
  • DevZone
  • Downloads
  • Documentation
  • Articles
  • Forums
  • Bugs
  • Forge
  • Blogs
 
  • Pages

    • About
    • Find and store the error return value in procedures or functions
  • Archives

    • August 2009
    • July 2009
    • June 2009
    • May 2009
    • April 2009
    • March 2009
    • February 2009
    • January 2009
    • December 2008
    • November 2008
    • October 2008
    • August 2008
    • July 2008
    • June 2008
    • May 2008
    • April 2008
  • Categories

    • MySQL 5.1 Features (3)
    • MySQL 5.4 New Features (2)
    • MySQL 6.0 New Features (5)
    • MySQL 6.x New Features (5)
    • News (8)
    • Personal Opinion (4)
    • Tiny Tweaks (10)
    • Uncategorized (19)



New Features In MySQL 6.x

« Sequences
WL#411 actually is about generated non-always-virtual columns »

Explain statements that aren’t SELECTs

I’ve been editing a task description in our worklog:
WL#706 Add EXPLAIN support for other statements (UPDATE/DELETE).

Currently MySQL supports EXPLAIN SELECT but there have been requests for EXPLAIN UPDATE, EXPLAIN DELETE, and so on. In fact it’s my impression that the proposition in WL#706 (transform the statement to a SELECT and then say EXPLAIN SELECT) is not what people want. But that’s okay, while a worklog is an early stage we allow simple ’solutions’ that might disappear later.

This entry was posted on Thursday, July 30th, 2009 at 8:34 pm and is filed under MySQL 6.x New Features. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

3 Responses to “Explain statements that aren’t SELECTs”

  1. Arjen Lentz Says:
    July 30th, 2009 at 11:04 pm

    The current implementation of EXPLAIN (SELECT) is not suitable for anything else. Transforming other queries into SELECTs does not necessarily result in the same execution plan, and is therefore useless.

  2. Roland Bouman Says:
    July 31st, 2009 at 10:02 am

    Hi!

    I agree with Arjen on this one.

    If you transform the original EXPLAIN statement to a EXPLAIN SELECT statement, and you can’t guarantee that the plan will be the same, then please don’t. It does more harm than good, leaving the users chasing red herrings.

  3. Mark Callaghan Says:
    July 31st, 2009 at 3:13 pm

    Production servers that I support have been hurt when someone used EXPLAIN of a select statement to understand the plan for a delete statement. The query used an index and the delete statement used a full table scan, thus locking all rows on a busy table. Insert/update/delete use different code in the optimizer. We need a real solution.

Leave a Reply

New Features In MySQL 6.x is proudly powered by WordPress MU running on Blogs.mysql.com.
Entries (RSS) and Comments (RSS).