From: Jorgen Loland Date: October 12 2011 12:23pm Subject: bzr push into mysql-trunk branch (jorgen.loland:3453 to 3454) WL#5860 List-Archive: http://lists.mysql.com/commits/141396 Message-Id: <20111012122339.636E140A@atum21.no.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3454 Jorgen Loland 2011-10-12 WL#5860: Windows and Solaris compilers don't like static const member variables. modified: sql/handler.cc sql/handler.h 3453 Oystein Grovlen 2011-10-12 WL#5559 - Factor tmp table out of optimizer. Part 3: Unify the code for creation of temporary tables for GROUP BY/ORDER BY Changed JOIN::create_intermediate_table() so that it can be used to create both temporary tables, and let it return a pointer to the created table, and use it to also create JOIN::exec_tmp_table2. @ sql/sql_select.cc 1. Extended JOIN::create_intermediate_table() with parameters for characteristics that vary between the two temporary tables. 2. Changed JOIN::create_intermediate_table() to return the pointer to the created temporary table, instead of assigning it to exec_tmp_table1. 3. Moved code in JOIN::create_intermediate_table() that are only relevant to exec_tmp_table1 to JOIN::exec(). 4. Moved code in JOIN::create_intermediate_table() related to optimization for distinct to a new private function JOIN::optimize_distinct(). (To be called from JOIN::exec() after creating the exec_tmp_table1 for time being, but longer term this should be moved to optimization phase.) 5. Call create_intermediate_table() to create exec_tmp_table2. @ sql/sql_select.h Created new private function JOIN::optimize_distinct() to optimize distinct when used on a subset of tables in query. Changed signature of JOIN::create_intermediate table to be able to handle creation of both temporary tables used for sorting. modified: sql/sql_select.cc sql/sql_select.h === modified file 'sql/handler.cc' --- a/sql/handler.cc 2011-09-30 08:45:16 +0000 +++ b/sql/handler.cc 2011-10-12 12:23:18 +0000 @@ -54,6 +54,8 @@ inline double log2(double x) } #endif +const double Cost_estimate::IO_BLOCK_READ_COST = 1.0; + /* While we have legacy_db_type, we have this array to check for dups and to find handlerton from legacy_db_type. === modified file 'sql/handler.h' --- a/sql/handler.h 2011-09-30 08:45:16 +0000 +++ b/sql/handler.h 2011-10-12 12:23:18 +0000 @@ -1070,7 +1070,7 @@ private: public: /// The cost of one I/O operation - static const double IO_BLOCK_READ_COST= 1.0; + static const double IO_BLOCK_READ_COST; Cost_estimate() : io_cost(0), No bundle (reason: useless for push emails).