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