diff options
author | drh <> | 2022-04-06 19:46:20 +0000 |
---|---|---|
committer | drh <> | 2022-04-06 19:46:20 +0000 |
commit | 200adc9e75fdc08beaf70536d3983b3434e45ded (patch) | |
tree | b66dc312a50f32673b9a9a3939b5641571e841c7 /src | |
parent | c2d0df95ba5312b420d7aa786ab805a5daeb1cc0 (diff) | |
download | sqlite-200adc9e75fdc08beaf70536d3983b3434e45ded.tar.gz sqlite-200adc9e75fdc08beaf70536d3983b3434e45ded.zip |
Faster parsing of the FROM clause in joins for the common case where there
is no INDEXED BY clause.
FossilOrigin-Name: 848b7a0ea99ddc52091b78313f018c07d00a0e28aa6da8c1cae709c1d03468fe
Diffstat (limited to 'src')
-rw-r--r-- | src/parse.y | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/parse.y b/src/parse.y index 2680e640a..e413739ff 100644 --- a/src/parse.y +++ b/src/parse.y @@ -695,7 +695,10 @@ stl_prefix(A) ::= seltablist(A) joinop(Y). { if( ALWAYS(A && A->nSrc>0) ) A->a[A->nSrc-1].fg.jointype = (u8)Y; } stl_prefix(A) ::= . {A = 0;} -seltablist(A) ::= stl_prefix(A) nm(Y) dbnm(D) as(Z) indexed_opt(I) +seltablist(A) ::= stl_prefix(A) nm(Y) dbnm(D) as(Z) on_opt(N) using_opt(U). { + A = sqlite3SrcListAppendFromTerm(pParse,A,&Y,&D,&Z,0,N,U); +} +seltablist(A) ::= stl_prefix(A) nm(Y) dbnm(D) as(Z) indexed_by(I) on_opt(N) using_opt(U). { A = sqlite3SrcListAppendFromTerm(pParse,A,&Y,&D,&Z,0,N,U); sqlite3SrcListIndexedBy(pParse, A, &I); @@ -813,9 +816,11 @@ on_opt(N) ::= . [OR] {N = 0;} // recognizes and interprets this as a special case. // %type indexed_opt {Token} +%type indexed_by {Token} indexed_opt(A) ::= . {A.z=0; A.n=0;} -indexed_opt(A) ::= INDEXED BY nm(X). {A = X;} -indexed_opt(A) ::= NOT INDEXED. {A.z=0; A.n=1;} +indexed_opt(A) ::= indexed_by(A). +indexed_by(A) ::= INDEXED BY nm(X). {A = X;} +indexed_by(A) ::= NOT INDEXED. {A.z=0; A.n=1;} %type using_opt {IdList*} %destructor using_opt {sqlite3IdListDelete(pParse->db, $$);} |