Page MenuHomePhabricator

DatabaseBase::selectSQLText() vs EXPLAIN
Closed, DeclinedPublic

Description

Author: ryan

Description:
Move EXPLAIN functionality from DatabaseBase::selectSQLText to inheriting DatabaseMysql class

EXPLAIN is implemented in different ways across different RDBMS. The current implementation of DatabaseBase::selectSQLText assumes we're using MySQL. Move this part of the abstract function to the specific DB that uses it in order to free up the abstract function to be inherited by other DB classes.

Patch provided to do just this.


Version: unspecified
Severity: enhancement

attachment mw.db-explain.diff ignored as obsolete

Details

Reference
bz23330

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 11:01 PM
bzimport set Reference to bz23330.
bzimport added a subscriber: Unknown Object (MLST).

Provided that no other DBMSes use this, feel free to go ahead and commit this.

EXPLAIN is also used by PG and Oracle, this patch will apparently break them.

To reduce code duplication, instead of overriding it in several classes, just rewrite it in DatabaseMssql, something like http://pastebin.com/QwrxLc3E

ryan wrote:

Move EXPLAIN functionality to child classes

Also touches DatabaseOracle and DatabasePostgres, fixes syntax error.

Attached:

ryan wrote:

Closing and changing this to "won't fix". MaxSem's solution works well and doesn't touch as much code, so I'll implement it. Thanks.

-yaauie