1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

ORDER BY optimization

Fixed new bug when reading field types


client/mysql.cc:
  Fixed output for -T
libmysql/libmysql.c:
  Filled missing fields in new MYSQL_FIELD structure
  Fixed new bug when reading field types
mysql-test/r/order_by.result:
  Result after new order by optimization
sql/opt_range.cc:
  New ORDER BY optimization
sql/opt_range.h:
  New ORDER BY optimization
sql/set_var.cc:
  Speed optimization
sql/sql_select.cc:
  New ORDER BY optimization
  
  This alllows MySQL to change a ref/range index from (a,b) to (a,c) when 'b' was not used to find rows and one did
  ORDER BY a,c or ORDER BY c
This commit is contained in:
unknown
2003-05-27 18:40:37 +03:00
parent 1540912eca
commit ef6d3a8060
7 changed files with 40 additions and 20 deletions

View File

@ -379,8 +379,8 @@ SQL_SELECT::~SQL_SELECT()
#undef index // Fix for Unixware 7
QUICK_SELECT::QUICK_SELECT(TABLE *table,uint key_nr,bool no_alloc)
:dont_free(0),error(0),index(key_nr),max_used_key_length(0),head(table),
it(ranges),range(0)
:dont_free(0),error(0),index(key_nr),max_used_key_length(0),
used_key_parts(0), head(table), it(ranges),range(0)
{
if (!no_alloc)
{
@ -2326,6 +2326,7 @@ get_quick_keys(PARAM *param,QUICK_SELECT *quick,KEY_PART *key,
flag);
set_if_bigger(quick->max_used_key_length,range->min_length);
set_if_bigger(quick->max_used_key_length,range->max_length);
set_if_bigger(quick->used_key_parts, (uint) key_tree->part+1);
if (!range) // Not enough memory
return 1;
quick->ranges.push_back(range);