1
by brian
clean slate |
1 |
/******************************************************
|
2 |
Simple SQL optimizer
|
|
3 |
||
4 |
(c) 1997 Innobase Oy
|
|
5 |
||
6 |
Created 12/21/1997 Heikki Tuuri
|
|
7 |
*******************************************************/
|
|
8 |
||
9 |
#ifndef pars0opt_h
|
|
10 |
#define pars0opt_h
|
|
11 |
||
12 |
#include "univ.i" |
|
13 |
#include "que0types.h" |
|
14 |
#include "usr0types.h" |
|
15 |
#include "pars0sym.h" |
|
16 |
#include "dict0types.h" |
|
17 |
#include "row0sel.h" |
|
18 |
||
19 |
/***********************************************************************
|
|
20 |
Optimizes a select. Decides which indexes to tables to use. The tables
|
|
21 |
are accessed in the order that they were written to the FROM part in the
|
|
22 |
select statement. */
|
|
23 |
||
24 |
void
|
|
25 |
opt_search_plan( |
|
26 |
/*============*/
|
|
27 |
sel_node_t* sel_node); /* in: parsed select node */ |
|
28 |
/***********************************************************************
|
|
29 |
Looks for occurrences of the columns of the table in the query subgraph and
|
|
30 |
adds them to the list of columns if an occurrence of the same column does not
|
|
31 |
already exist in the list. If the column is already in the list, puts a value
|
|
32 |
indirection to point to the occurrence in the column list, except if the
|
|
33 |
column occurrence we are looking at is in the column list, in which case
|
|
34 |
nothing is done. */
|
|
35 |
||
36 |
void
|
|
37 |
opt_find_all_cols( |
|
38 |
/*==============*/
|
|
39 |
ibool copy_val, /* in: if TRUE, new found columns are |
|
40 |
added as columns to copy */
|
|
41 |
dict_index_t* index, /* in: index to use */ |
|
42 |
sym_node_list_t* col_list, /* in: base node of a list where |
|
43 |
to add new found columns */
|
|
44 |
plan_t* plan, /* in: plan or NULL */ |
|
45 |
que_node_t* exp); /* in: expression or condition */ |
|
46 |
/************************************************************************
|
|
47 |
Prints info of a query plan. */
|
|
48 |
||
49 |
void
|
|
50 |
opt_print_query_plan( |
|
51 |
/*=================*/
|
|
52 |
sel_node_t* sel_node); /* in: select node */ |
|
53 |
||
54 |
#ifndef UNIV_NONINL
|
|
55 |
#include "pars0opt.ic" |
|
56 |
#endif
|
|
57 |
||
58 |
#endif
|