MySQL 9.1.0
Source Code Documentation
pars0opt.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (c) 1997, 2024, Oracle and/or its affiliates.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License, version 2.0, as published by the
7Free Software Foundation.
8
9This program is designed to work with certain software (including
10but not limited to OpenSSL) that is licensed under separate terms,
11as designated in a particular file or component or in included license
12documentation. The authors of MySQL hereby grant you an additional
13permission to link the program and your derivative works with the
14separately licensed software that they have either included with
15the program or referenced in the documentation.
16
17This program is distributed in the hope that it will be useful, but WITHOUT
18ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
20for more details.
21
22You should have received a copy of the GNU General Public License along with
23this program; if not, write to the Free Software Foundation, Inc.,
2451 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
26*****************************************************************************/
27
28/** @file include/pars0opt.h
29 Simple SQL optimizer
30
31 Created 12/21/1997 Heikki Tuuri
32 *******************************************************/
33
34#ifndef pars0opt_h
35#define pars0opt_h
36
37#include "dict0types.h"
38#include "pars0sym.h"
39#include "que0types.h"
40#include "row0sel.h"
41#include "univ.i"
42#include "usr0types.h"
43
44/** Optimizes a select. Decides which indexes to tables to use. The tables
45 are accessed in the order that they were written to the FROM part in the
46 select statement. */
47void opt_search_plan(sel_node_t *sel_node); /*!< in: parsed select node */
48/** Looks for occurrences of the columns of the table in the query subgraph and
49 adds them to the list of columns if an occurrence of the same column does not
50 already exist in the list. If the column is already in the list, puts a value
51 indirection to point to the occurrence in the column list, except if the
52 column occurrence we are looking at is in the column list, in which case
53 nothing is done. */
55 bool copy_val, /*!< in: if true, new found columns are
56 added as columns to copy */
57 dict_index_t *index, /*!< in: index to use */
58 sym_node_list_t *col_list, /*!< in: base node of a list where
59 to add new found columns */
60 plan_t *plan, /*!< in: plan or NULL */
61 que_node_t *exp); /*!< in: expression or condition */
62
63#endif
Data dictionary global types.
void opt_search_plan(sel_node_t *sel_node)
Optimizes a select.
Definition: pars0opt.cc:981
void opt_find_all_cols(bool copy_val, dict_index_t *index, sym_node_list_t *col_list, plan_t *plan, que_node_t *exp)
Looks for occurrences of the columns of the table in the query subgraph and adds them to the list of ...
Definition: pars0opt.cc:744
SQL parser symbol table.
Query graph global types.
void que_node_t
Definition: que0types.h:41
Select.
Data structure for an index.
Definition: dict0mem.h:1041
Query plan.
Definition: row0sel.h:247
Select statement node.
Definition: row0sel.h:329
Version control for database, common definitions, and include files.
Users and sessions global types.