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

DISTINCT optimization

Fixes when using column privileges
Manual updates


Docs/manual.texi:
  Comments from MySQL training + distinct optimization
extra/my_print_defaults.c:
  Added --defaults-extra-file
include/my_sys.h:
  Added --defaults-extra-file
mysys/default.c:
  Added --defaults-extra-file
sql/sql_acl.cc:
  Tables with only column privileges didn't show up in SHOW GRANTS or SHOW TABLES
sql/sql_select.cc:
  DISTINCT optimization
sql/sql_select.h:
  DISTINCT optimization
BitKeeper/etc/logging_ok:
  Logging to logging@openlogging.org accepted
This commit is contained in:
unknown
2000-10-06 21:15:03 +03:00
parent 295c3d1fa9
commit 6991b70c87
8 changed files with 283 additions and 131 deletions

View File

@ -79,36 +79,36 @@ class JOIN;
typedef struct st_join_table {
TABLE *table;
int (*read_first_record)(struct st_join_table *tab);
int (*next_select)(JOIN *,struct st_join_table *,bool);
bool cached_eq_ref_table,eq_ref_table;
READ_RECORD read_record;
uint keys; /* all keys with can be used */
key_map const_keys; /* Keys with constant part */
key_map checked_keys; /* Keys checked in find_best */
key_map needed_reg;
ha_rows records,found_records,read_time;
table_map dependent,key_dependent;
uint use_quick,index;
uint status; // Save status for cache
enum join_type type;
JOIN_CACHE cache;
KEYUSE *keyuse; /* pointer to first used key */
SQL_SELECT *select;
COND *select_cond;
QUICK_SELECT *quick;
Item *on_expr;
uint used_fields,used_fieldlength,used_blobs;
const char *info;
int (*read_first_record)(struct st_join_table *tab);
int (*next_select)(JOIN *,struct st_join_table *,bool);
READ_RECORD read_record;
double worst_seeks;
key_map const_keys; /* Keys with constant part */
key_map checked_keys; /* Keys checked in find_best */
key_map needed_reg;
ha_rows records,found_records,read_time;
table_map dependent,key_dependent;
uint keys; /* all keys with can be used */
uint use_quick,index;
uint status; // Save status for cache
uint used_fields,used_fieldlength,used_blobs;
enum join_type type;
bool cached_eq_ref_table,eq_ref_table,not_used_in_distinct;
TABLE_REF ref;
JOIN_CACHE cache;
} JOIN_TAB;
typedef struct st_position { /* Used in find_best */
double records_read;
JOIN_TAB *table;
KEYUSE *key;
double records_read;
} POSITION;
@ -116,16 +116,16 @@ typedef struct st_position { /* Used in find_best */
class TMP_TABLE_PARAM {
public:
List<Item> copy_funcs;
Copy_field *copy_field;
byte *group_buff;
Item_result_field **funcs;
MI_COLUMNDEF *recinfo,*start_recinfo;
KEY *keyinfo;
ha_rows end_write_records;
uint copy_field_count,field_count,sum_func_count,func_count;
uint group_parts,group_length;
uint quick_group;
Copy_field *copy_field;
byte *group_buff;
ha_rows end_write_records;
Item_result_field **funcs;
List<Item> copy_funcs;
MI_COLUMNDEF *recinfo,*start_recinfo;
KEY *keyinfo;
TMP_TABLE_PARAM() :group_parts(0),group_length(0),copy_field(0) {}
~TMP_TABLE_PARAM()
@ -148,7 +148,7 @@ class JOIN {
uint send_group_parts;
bool sort_and_group,first_record,full_join,group, no_field_update;
table_map const_table_map;
ha_rows send_records;
ha_rows send_records,found_records;
POSITION positions[MAX_TABLES+1],best_positions[MAX_TABLES+1];
double best_read;
List<Item> *fields;