translation_unit
comment "/*\n** 2001 September 15\n**\n** The author disclaims copyright"...
preproc_include
#include "#include"
string_literal
" "\""
string_content "sqliteInt.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "whereInt.h"
" "\""
comment "/*\n** Extra information appended to the end of sqlite3_index"...
type_definition
typedef "typedef"
struct_specifier
struct "struct"
type_identifier "HiddenIndexInfo"
type_identifier "HiddenIndexInfo"
; ";"
struct_specifier (+46 nodes collapsed)
; ";"
comment "/* Size (in bytes) of a HiddenIndeInfo object sufficient to "...
preproc_function_def
#define "#define"
identifier "SZ_HIDDENINDEXINFO"
preproc_params
( "("
identifier "N"
) ")"
preproc_arg "(offsetof(HiddenIndexInfo,aRhs) + (N)*sizeof(sqlite3_value*)"...
comment "/* Forward declaration of methods */"
declaration (+22 nodes collapsed)
comment "/*\n** Return the estimated number of output rows from a WHER"...
function_definition (+22 nodes collapsed)
comment "/*\n** Return one of the WHERE_DISTINCT_xxxxx values to indic"...
function_definition (+22 nodes collapsed)
comment "/*\n** Return the number of ORDER BY terms that are satisfied"...
function_definition (+33 nodes collapsed)
comment "/*\n** In the ORDER BY LIMIT optimization, if the inner-most "...
function_definition (+96 nodes collapsed)
comment "/*\n** While generating code for the min/max optimization, af"...
function_definition (+154 nodes collapsed)
comment "/*\n** Return the VDBE address or label to jump to in order t"...
function_definition (+36 nodes collapsed)
comment "/*\n** Return the VDBE address or label to jump to in order t"...
function_definition (+22 nodes collapsed)
comment "/*\n** Return ONEPASS_OFF (0) if an UPDATE or DELETE statemen"...
function_definition (+116 nodes collapsed)
comment "/*\n** Return TRUE if the WHERE loop uses the OP_DeferredSeek"...
function_definition (+22 nodes collapsed)
comment "/*\n** Move the content of pSrc into pDest\n*/"
function_definition (+71 nodes collapsed)
comment "/*\n** Try to insert a new prerequisite/cost entry into the W"...
function_definition (+328 nodes collapsed)
comment "/*\n** Return the bitmask for the given cursor number. Retur"...
function_definition (+166 nodes collapsed)
comment "/* Allocate memory that is automatically freed when pWInfo i"...
function_definition (+111 nodes collapsed)
function_definition (+109 nodes collapsed)
comment "/*\n** Create a new mask for cursor iCursor.\n**\n** There is o"...
function_definition (+61 nodes collapsed)
comment "/*\n** If the right-hand branch of the expression is a TK_COL"...
function_definition (+79 nodes collapsed)
comment "/*\n** Term pTerm is guaranteed to be a WO_IN term. It may be"...
function_definition (+242 nodes collapsed)
comment "/*\n** Advance to the next WhereTerm that matches according t"...
function_definition (+1064 nodes collapsed)
comment "/*\n** This is whereScanInit() for the case of an index on an"...
function_definition (+47 nodes collapsed)
comment "/*\n** Initialize a WHERE clause scanner object. Return a po"...
function_definition (+362 nodes collapsed)
comment "/*\n** Search for a term in the WHERE clause that is of the f"...
function_definition (+206 nodes collapsed)
comment "/*\n** This function searches pList for an entry that matches"...
function_definition (+230 nodes collapsed)
comment "/*\n** Return TRUE if the iCol-th column of index pIdx is NOT"...
function_definition (+143 nodes collapsed)
comment "/*\n** Return true if the DISTINCT expression-list passed as "...
function_definition (+400 nodes collapsed)
comment "/*\n** Estimate the logarithm of the input value to base 2.\n*"...
function_definition (+35 nodes collapsed)
comment "/*\n** Convert OP_Column opcodes to OP_Copy in previously gen"...
function_definition (+380 nodes collapsed)
comment "/*\n** Two routines for printing the content of an sqlite3_in"...
preproc_if (+467 nodes collapsed)
comment "/*\n** We know that pSrc is an operand of an outer join. Ret"...
function_definition (+264 nodes collapsed)
preproc_ifdef (+160 nodes collapsed)
comment "/* SQLITE_OMIT_AUTOMATIC_INDEX */"
preproc_ifdef (+317 nodes collapsed)
preproc_ifdef (+2952 nodes collapsed)
comment "/* SQLITE_OMIT_AUTOMATIC_INDEX */"
comment "/*\n** Generate bytecode that will initialize a Bloom filter "...
function_definition (+1093 nodes collapsed)
preproc_ifdef (+2794 nodes collapsed)
comment "/* !defined(SQLITE_OMIT_VIRTUALTABLE) */"
preproc_ifdef (+1165 nodes collapsed)
comment "/* SQLITE_ENABLE_STAT4 */"
comment "/*\n** If it is not NULL, pTerm is a term that provides an up"...
function_definition (+110 nodes collapsed)
preproc_ifdef (+113 nodes collapsed)
preproc_ifdef (+646 nodes collapsed)
comment "/* SQLITE_ENABLE_STAT4 */"
comment "/*\n** This function is used to estimate the number of rows t"...
function_definition (+1313 nodes collapsed)
preproc_ifdef (+381 nodes collapsed)
comment "/* SQLITE_ENABLE_STAT4 */"
preproc_ifdef (+290 nodes collapsed)
comment "/* SQLITE_ENABLE_STAT4 */"
preproc_if (+618 nodes collapsed)
preproc_ifdef (+66 nodes collapsed)
preproc_ifdef (+884 nodes collapsed)
comment "/*\n** Convert bulk memory into a valid WhereLoop that can be"...
function_definition (+64 nodes collapsed)
comment "/*\n** Clear the WhereLoop.u union. Leave WhereLoop.pLTerm i"...
function_definition (+218 nodes collapsed)
comment "/*\n** Deallocate internal memory used by a WhereLoop object."...
function_definition (+111 nodes collapsed)
comment "/*\n** Increase the memory allocation for pLoop->aLTerm[] to "...
function_definition (+192 nodes collapsed)
comment "/*\n** Transfer content from the second pLoop into the first."...
function_definition (+208 nodes collapsed)
comment "/*\n** Delete a WhereLoop object\n*/"
function_definition (+54 nodes collapsed)
comment "/*\n** Free a WhereInfo structure\n*/"
function_definition (+163 nodes collapsed)
comment "/*\n** Return TRUE if X is a proper subset of Y but is of equ"...
function_definition (+399 nodes collapsed)
comment "/*\n** Try to adjust the cost and number of output rows of Wh"...
function_definition (+360 nodes collapsed)
comment "/*\n** Search the list of WhereLoops in *ppPrev looking for o"...
function_definition (+403 nodes collapsed)
comment "/*\n** Insert or replace a WhereLoop entry using the template"...
function_definition (+769 nodes collapsed)
comment "/*\n** Callback for estLikePatternLength().\n**\n** If this nod"...
function_definition (+281 nodes collapsed)
comment "/*\n** Return the length of the longest string literal in the"...
function_definition (+99 nodes collapsed)
comment "/*\n** Adjust the WhereLoop.nOut value downward to account fo"...
function_definition (+829 nodes collapsed)
comment "/*\n** Term pTerm is a vector range comparison operation. The"...
function_definition (+455 nodes collapsed)
comment "/*\n** Adjust the cost C by the costMult factor T. This only"...
preproc_ifdef (+25 nodes collapsed)
comment "/*\n** We have so far matched pBuilder->pNew->u.btree.nEq ter"...
function_definition (+3718 nodes collapsed)
comment "/*\n** Return True if it is possible that pIndex might be use"...
function_definition (+349 nodes collapsed)
comment "/* Check to see if a partial index with pPartIndexWhere can "...
function_definition (+289 nodes collapsed)
comment "/*\n** pIdx is an index containing expressions. Check it see"...
function_definition (+115 nodes collapsed)
comment "/*\n** Structure passed to the whereIsCoveringIndex Walker ca"...
type_definition
typedef "typedef"
struct_specifier
struct "struct"
type_identifier "CoveringIndexCheck"
type_identifier "CoveringIndexCheck"
; ";"
struct_specifier (+28 nodes collapsed)
; ";"
comment "/*\n** Information passed in is pWalk->u.pCovIdxCk. Call it "...
function_definition (+264 nodes collapsed)
comment "/*\n** pIdx is an index that covers all of the low-number col"...
function_definition (+303 nodes collapsed)
comment "/*\n** This is an sqlite3ParserAddCleanup() callback that is "...
function_definition (+102 nodes collapsed)
comment "/*\n** This function is called for a partial index - one with"...
function_definition (+593 nodes collapsed)
comment "/*\n** Add all WhereLoop objects for a single table of the jo"...
function_definition (+2466 nodes collapsed)
preproc_ifdef (+3662 nodes collapsed)
comment "/* SQLITE_OMIT_VIRTUALTABLE */"
comment "/*\n** Add WhereLoop entries to handle OR terms. This works "...
function_definition (+1153 nodes collapsed)
comment "/*\n** Add all WhereLoop objects for all tables\n*/"
function_definition (+821 nodes collapsed)
comment "/* Implementation of the order-by-subquery optimization:\n**\n"...
function_definition (+536 nodes collapsed)
comment "/*\n** Examine a WherePath (with the addition of the extra Wh"...
function_definition (+2644 nodes collapsed)
comment "/*\n** If the WHERE_GROUPBY flag is set in the mask passed to"...
function_definition (+56 nodes collapsed)
preproc_ifdef (+125 nodes collapsed)
comment "/*\n** Return the cost of sorting nRow rows, assuming that th"...
function_definition (+291 nodes collapsed)
comment "/*\n** Compute the maximum number of paths in the solver algo"...
function_definition
storage_class_specifier
static "static"
primitive_type "int"
function_declarator
identifier "computeMxChoice"
parameter_list
( "("
parameter_declaration
type_identifier "WhereInfo"
pointer_declarator
* "*"
identifier "pWInfo"
) ")"
compound_statement
{ "{"
declaration
primitive_type "int"
init_declarator
identifier "nLoop"
= "="
field_expression
identifier "pWInfo"
-> "->"
field_identifier "nLevel"
; ";"
comment "/* Number of terms in the join */"
declaration
type_identifier "WhereLoop"
pointer_declarator
* "*"
identifier "pWLoop"
; ";"
comment "/* For looping over WhereLoops */"
preproc_ifdef (+80 nodes collapsed)
comment "/* SQLITE_DEBUG */"
if_statement
if "if"
parenthesized_expression (+31 nodes collapsed)
compound_statement
{ "{"
declaration
type_identifier "SrcItem"
pointer_declarator
* "*"
identifier "aFromTabs"
; ";"
comment "/* All terms of the FROM clause */"
declaration
primitive_type "int"
identifier "iFromIdx"
; ";"
comment "/* Term of FROM clause is the candidate fact-table */"
declaration
type_identifier "Bitmask"
identifier "m"
; ";"
comment "/* Bitmask for candidate fact-table */"
declaration
type_identifier "Bitmask"
init_declarator
identifier "mSelfJoin"
= "="
number_literal "0"
; ";"
comment "/* Tables that cannot be dimension tables */"
declaration
type_identifier "WhereLoop"
pointer_declarator
* "*"
identifier "pStart"
; ";"
comment "/* Where to start searching for dimension-tables */"
expression_statement
assignment_expression
field_expression
identifier "pWInfo"
-> "->"
field_identifier "bStarDone"
= "="
number_literal "1"
; ";"
comment "/* Only do this computation once */"
comment "/* Look for fact tables with four or more dimensions where t"...
expression_statement
call_expression
identifier "assert"
argument_list
( "("
unary_expression
! "!"
field_expression
identifier "pWInfo"
-> "->"
field_identifier "bStarUsed"
) ")"
; ";"
expression_statement
assignment_expression
identifier "aFromTabs"
= "="
field_expression
field_expression
identifier "pWInfo"
-> "->"
field_identifier "pTabList"
-> "->"
field_identifier "a"
; ";"
expression_statement
assignment_expression
identifier "pStart"
= "="
field_expression
identifier "pWInfo"
-> "->"
field_identifier "pLoops"
; ";"
for_statement
for "for"
( "("
comma_expression
assignment_expression
identifier "iFromIdx"
= "="
number_literal "0"
, ","
assignment_expression
identifier "m"
= "="
number_literal "1"
; ";"
binary_expression
identifier "iFromIdx"
< "<"
identifier "nLoop"
; ";"
comma_expression
update_expression
identifier "iFromIdx"
++ "++"
, ","
assignment_expression
identifier "m"
<<= "<<="
number_literal "1"
) ")"
compound_statement
{ "{"
declaration
primitive_type "int"
init_declarator
identifier "nDep"
= "="
number_literal "0"
; ";"
comment "/* Number of dimension tables */"
declaration
type_identifier "LogEst"
identifier "mxRun"
; ";"
comment "/* Maximum SCAN cost of a fact table */"
declaration
type_identifier "Bitmask"
init_declarator
identifier "mSeen"
= "="
number_literal "0"
; ";"
comment "/* Mask of dimension tables */"
declaration
type_identifier "SrcItem"
pointer_declarator
* "*"
identifier "pFactTab"
; ";"
comment "/* The candidate fact table */"
expression_statement
assignment_expression
identifier "pFactTab"
= "="
binary_expression
identifier "aFromTabs"
+ "+"
identifier "iFromIdx"
; ";"
if_statement
if "if"
parenthesized_expression (+25 nodes collapsed)
compound_statement
{ "{"
comment "/* If the candidate fact-table is the right table of an oute"...
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
binary_expression
identifier "iFromIdx"
+ "+"
number_literal "4"
> ">"
identifier "nLoop"
) ")"
break_statement
break "break"
; ";"
comment "/* Impossible to reach nDep>=4 */"
while_statement (+27 nodes collapsed)
} "}"
for_statement
for "for"
( "("
assignment_expression
identifier "pWLoop"
= "="
identifier "pStart"
; ";"
identifier "pWLoop"
; ";"
assignment_expression
identifier "pWLoop"
= "="
field_expression
identifier "pWLoop"
-> "->"
field_identifier "pNextLoop"
) ")"
compound_statement
{ "{"
if_statement
if "if"
parenthesized_expression (+32 nodes collapsed)
compound_statement
{ "{"
comment "/* Fact-tables and dimension-tables cannot be separated by a"...
break_statement
break "break"
; ";"
} "}"
if_statement (+104 nodes collapsed)
} "}"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "nDep"
<= "<="
number_literal "3"
) ")"
continue_statement
continue "continue"
; ";"
comment "/* If we reach this point, it means that pFactTab is a fact "...
preproc_ifdef (+52 nodes collapsed)
expression_statement
assignment_expression
field_expression
identifier "pWInfo"
-> "->"
field_identifier "bStarUsed"
= "="
number_literal "1"
; ";"
comment "/* Compute the maximum cost of any WhereLoop for the\n *"...
expression_statement
assignment_expression
identifier "mxRun"
= "="
identifier "LOGEST_MIN"
; ";"
for_statement (+72 nodes collapsed)
if_statement
if "if"
parenthesized_expression
( "("
call_expression
identifier "ALWAYS"
argument_list
( "("
binary_expression
identifier "mxRun"
< "<"
identifier "LOGEST_MAX"
) ")"
) ")"
expression_statement
update_expression
identifier "mxRun"
++ "++"
; ";"
comment "/* Increase the cost of table scans for dimension tables to "...
for_statement (+185 nodes collapsed)
} "}"
preproc_ifdef (+92 nodes collapsed)
} "}"
return_statement
return "return"
conditional_expression
field_expression
identifier "pWInfo"
-> "->"
field_identifier "bStarUsed"
? "?"
number_literal "18"
: ":"
number_literal "12"
; ";"
} "}"
comment "/*\n** Two WhereLoop objects, pCandidate and pBaseline, are k"...
function_definition (+114 nodes collapsed)
comment "/*\n** Given the list of WhereLoop objects at pWInfo->pLoops,"...
function_definition (+3437 nodes collapsed)
comment "/*\n** This routine implements a heuristic designed to improv"...
function_definition (+309 nodes collapsed)
comment "/*\n** Most queries use only a single table (they are not joi"...
function_definition (+964 nodes collapsed)
comment "/*\n** Helper function for exprIsDeterministic().\n*/"
function_definition (+68 nodes collapsed)
comment "/*\n** Return true if the expression contains no non-determin"...
function_definition (+86 nodes collapsed)
preproc_ifdef (+163 nodes collapsed)
comment "/* Attempt to omit tables from a join that do not affect the"...
function_definition (+830 nodes collapsed)
comment "/*\n** Check to see if there are any SEARCH loops that might "...
function_definition (+370 nodes collapsed)
comment "/*\n** The index pIdx is used by a query and contains one or "...
function_definition (+517 nodes collapsed)
comment "/*\n** Set the reverse-scan order mask to one for all tables "...
function_definition (+151 nodes collapsed)
comment "/*\n** Generate the beginning of the loop used for WHERE clau"...
function_definition (+5441 nodes collapsed)
comment "/*\n** Part of sqlite3WhereEnd() will rewrite opcodes to refe"...
preproc_ifdef (+99 nodes collapsed)
comment "/*\n** Generate the end of the WHERE loop. See comments on\n*"...
function_definition (+3371 nodes collapsed)