21
21
#include <config.h>
22
#include <drizzled/session.h>
23
22
#include <drizzled/join_table.h>
23
#include <drizzled/optimizer/access_method/index.h>
24
24
#include <drizzled/sql_select.h>
25
#include <drizzled/optimizer/access_method/index.h>
25
#include <drizzled/table.h>
27
27
using namespace drizzled;
29
bool optimizer::Index::getStats(Table *table,
29
void optimizer::Index::getStats(Table& table, JoinTable& join_tab)
32
table->status= STATUS_NO_RECORD;
35
delete join_tab->select->quick;
36
join_tab->select->quick= 0;
39
delete join_tab->quick;
42
if (table->covering_keys.test(join_tab->ref.key) &&
46
table->cursor->extra(HA_EXTRA_KEYREAD);
49
if (join_tab->type == AM_REF)
51
join_tab->read_first_record= join_read_always_key;
52
join_tab->read_record.read_record= join_tab->insideout_match_tab ?
31
table.status= STATUS_NO_RECORD;
34
delete join_tab.select->quick;
35
join_tab.select->quick= 0;
38
delete join_tab.quick;
41
if (table.covering_keys.test(join_tab.ref.key) &&
45
table.cursor->extra(HA_EXTRA_KEYREAD);
48
if (join_tab.type == AM_REF)
50
join_tab.read_first_record= join_read_always_key;
51
join_tab.read_record.read_record= join_tab.insideout_match_tab ?
53
52
join_read_next_same_diff : join_read_next_same;
57
join_tab->read_first_record= join_read_always_key_or_null;
58
join_tab->read_record.read_record= join_read_next_same_or_null;
56
join_tab.read_first_record= join_read_always_key_or_null;
57
join_tab.read_record.read_record= join_read_next_same_or_null;