CUBRID Engine  latest
query_planner.h File Reference
#include "optimizer.h"
#include "query_bitset.h"
Include dependency graph for query_planner.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  qo_plan_vtbl
 
struct  qo_plan
 
struct  qo_planvec
 
struct  qo_info
 
struct  qo_planner
 

Namespaces

 cubxasl
 

Macros

#define QO_CPU_WEIGHT   0.0025
 
#define qo_plan_add_ref(p)   ((p->refcount)++, (p))
 
#define qo_plan_del_ref(p)
 
#define qo_plan_release(p)
 
#define NPLANS   4 /* Maximum number of plans to keep in a PlanVec */
 

Typedefs

typedef struct qo_plan_vtbl QO_PLAN_VTBL
 
typedef struct qo_planvec QO_PLANVEC
 

Enumerations

enum  QO_PLANTYPE {
  QO_PLANTYPE_SCAN, QO_PLANTYPE_SORT, QO_PLANTYPE_JOIN, QO_PLANTYPE_FOLLOW,
  QO_PLANTYPE_WORST
}
 
enum  QO_SCANMETHOD {
  QO_SCANMETHOD_SEQ_SCAN, QO_SCANMETHOD_INDEX_SCAN, QO_SCANMETHOD_INDEX_ORDERBY_SCAN, QO_SCANMETHOD_INDEX_GROUPBY_SCAN,
  QO_SCANMETHOD_INDEX_SCAN_INSPECT
}
 
enum  QO_JOINMETHOD { QO_JOINMETHOD_NL_JOIN, QO_JOINMETHOD_IDX_JOIN, QO_JOINMETHOD_MERGE_JOIN }
 
enum  QO_PLAN_COMPARE_RESULT { PLAN_COMP_UNK = -2, PLAN_COMP_LT = -1, PLAN_COMP_EQ = 0, PLAN_COMP_GT = 1 }
 
enum  QO_PLAN_ULTI_RANGE_OPT_USE { PLAN_MULTI_RANGE_OPT_USE = 1, PLAN_MULTI_RANGE_OPT_NO = 0, PLAN_MULTI_RANGE_OPT_CANNOT_USE = -1, PLAN_MULTI_RANGE_OPT_CAN_USE = -2 }
 

Functions

QO_PLANqo_planner_search (QO_ENV *)
 
void qo_planner_free (QO_PLANNER *)
 
void qo_plans_stats (FILE *)
 
void qo_info_stats (FILE *)
 
bool qo_is_seq_scan (QO_PLAN *)
 
bool qo_is_iscan (QO_PLAN *)
 
bool qo_is_iscan_from_groupby (QO_PLAN *)
 
bool qo_is_iscan_from_orderby (QO_PLAN *)
 
bool qo_is_interesting_order_scan (QO_PLAN *)
 
bool qo_is_all_unique_index_columns_are_equi_terms (QO_PLAN *plan)
 
bool qo_has_sort_limit_subplan (QO_PLAN *plan)
 

Macro Definition Documentation

#define NPLANS   4 /* Maximum number of plans to keep in a PlanVec */

Definition at line 220 of file query_planner.h.

Referenced by qo_check_planvec(), and qo_init_planvec().

#define QO_CPU_WEIGHT   0.0025
#define qo_plan_add_ref (   p)    ((p->refcount)++, (p))
#define qo_plan_del_ref (   p)
Value:
do { \
QO_PLAN *__p = (p); \
if ((__p) && --(__p->refcount) == 0) \
} while(0)
struct qo_plan QO_PLAN
Definition: optimizer.h:132
static void qo_plan_free(QO_PLAN *)
if(extra_options)
Definition: dynamic_load.c:958
const char ** p
Definition: dynamic_load.c:945

Definition at line 209 of file query_planner.h.

Referenced by qo_check_planvec(), qo_partition_free(), qo_plan_del_ref_func(), qo_plan_discard(), qo_planner_free(), qo_search_planner(), and qo_uninit_planvec().

#define qo_plan_release (   p)
Value:
do { \
QO_PLAN *__p = (p); \
if ((__p) && (__p->refcount) == 0) \
} while(0)
struct qo_plan QO_PLAN
Definition: optimizer.h:132
static void qo_plan_free(QO_PLAN *)
if(extra_options)
Definition: dynamic_load.c:958
const char ** p
Definition: dynamic_load.c:945

Definition at line 214 of file query_planner.h.

Referenced by qo_check_new_best_plan_on_info(), qo_check_plan_on_info(), and qo_index_scan_new().

Typedef Documentation

typedef struct qo_plan_vtbl QO_PLAN_VTBL

Definition at line 70 of file query_planner.h.

typedef struct qo_planvec QO_PLANVEC

Definition at line 222 of file query_planner.h.

Enumeration Type Documentation

Enumerator
QO_JOINMETHOD_NL_JOIN 
QO_JOINMETHOD_IDX_JOIN 
QO_JOINMETHOD_MERGE_JOIN 

Definition at line 63 of file query_planner.h.

Enumerator
PLAN_COMP_UNK 
PLAN_COMP_LT 
PLAN_COMP_EQ 
PLAN_COMP_GT 

Definition at line 83 of file query_planner.h.

Enumerator
PLAN_MULTI_RANGE_OPT_USE 
PLAN_MULTI_RANGE_OPT_NO 
PLAN_MULTI_RANGE_OPT_CANNOT_USE 
PLAN_MULTI_RANGE_OPT_CAN_USE 

Definition at line 91 of file query_planner.h.

Enumerator
QO_PLANTYPE_SCAN 
QO_PLANTYPE_SORT 
QO_PLANTYPE_JOIN 
QO_PLANTYPE_FOLLOW 
QO_PLANTYPE_WORST 

Definition at line 45 of file query_planner.h.

Enumerator
QO_SCANMETHOD_SEQ_SCAN 
QO_SCANMETHOD_INDEX_SCAN 
QO_SCANMETHOD_INDEX_ORDERBY_SCAN 
QO_SCANMETHOD_INDEX_GROUPBY_SCAN 
QO_SCANMETHOD_INDEX_SCAN_INSPECT 

Definition at line 54 of file query_planner.h.

Function Documentation

void qo_info_stats ( FILE *  )

Definition at line 6286 of file query_planner.c.

References infos_allocated, and infos_deallocated.

Referenced by qo_print_stats().

Here is the caller graph for this function:

bool qo_is_all_unique_index_columns_are_equi_terms ( QO_PLAN plan)

Definition at line 9883 of file query_planner.c.

References qo_plan::plan_un, qo_is_iscan(), and qo_plan::scan.

Referenced by qo_plan_cmp().

Here is the caller graph for this function:

bool qo_is_seq_scan ( QO_PLAN )

Definition at line 7679 of file query_planner.c.

References qo_plan::plan_type, qo_plan::plan_un, QO_PLANTYPE_SCAN, QO_SCANMETHOD_SEQ_SCAN, and qo_plan::scan.

Referenced by gen_outer(), qo_find_best_nljoin_inner_plan_on_info(), qo_nljoin_cost(), and qo_plan_cmp().

Here is the caller graph for this function:

QO_PLAN* qo_planner_search ( QO_ENV )

Definition at line 7451 of file query_planner.c.

References NULL, qo_alloc_planner(), qo_clean_planner(), qo_info_nodes_init(), qo_plans_init(), and qo_search_planner().

Referenced by qo_optimize_helper().

Here is the caller graph for this function:

void qo_plans_stats ( FILE *  )

Definition at line 4607 of file query_planner.c.

References qo_plans_allocated, qo_plans_deallocated, qo_plans_demalloced, and qo_plans_malloced.

Referenced by qo_print_stats().

Here is the caller graph for this function: