Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
78511d8f
Commit
78511d8f
authored
26 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
Optimizer fix for samekeys.
parent
fe35ffe7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/backend/optimizer/util/keys.c
+16
-6
16 additions, 6 deletions
src/backend/optimizer/util/keys.c
src/backend/parser/gram.c
+5225
-5025
5225 additions, 5025 deletions
src/backend/parser/gram.c
src/backend/parser/parse.h
+50
-48
50 additions, 48 deletions
src/backend/parser/parse.h
with
5291 additions
and
5079 deletions
src/backend/optimizer/util/keys.c
+
16
−
6
View file @
78511d8f
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/keys.c,v 1.1
1
1999/02/09 0
3:51:26
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/keys.c,v 1.1
2
1999/02/09 0
6:30:39
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -108,25 +108,35 @@ extract_subkey(JoinKey *jk, int which_subkey)
/*
* samekeys--
* Returns t iff two sets of path keys are equivalent. They are
* equivalent if the first subkey (var node) within each sublist of
* list 'keys1' is contained within the corresponding sublist of 'keys2'.
* equivalent if the first Var nodes match the second Var nodes.
*
* XXX It isn't necessary to check that each sublist exactly contain
* the same elements because if the routine that built these
* sublists together is correct, having one element in common
* implies having all elements in common.
* Huh? bjm
*
*/
bool
samekeys
(
List
*
keys1
,
List
*
keys2
)
{
List
*
key1
,
*
key2
;
*
key2
,
*
key1a
,
*
key2a
;
for
(
key1
=
keys1
,
key2
=
keys2
;
key1
!=
NIL
&&
key2
!=
NIL
;
for
(
key1
=
keys1
,
key2
=
keys2
;
key1
!=
NIL
&&
key2
!=
NIL
;
key1
=
lnext
(
key1
),
key2
=
lnext
(
key2
))
if
(
!
member
(
lfirst
((
List
*
)
lfirst
(
key1
)),
lfirst
(
key2
)))
{
for
(
key1a
=
lfirst
(
key1
),
key2a
=
lfirst
(
key2
);
key1a
!=
NIL
&&
key2a
!=
NIL
;
key1a
=
lnext
(
key1a
),
key2a
=
lnext
(
key2a
))
if
(
!
equal
(
lfirst
(
key1a
),
lfirst
(
key2a
)))
return
false
;
if
(
key1a
!=
NIL
)
return
false
;
}
/* Now the result should be true if list keys2 has at least as many
* entries as keys1, ie, we did not fall off the end of keys2 first.
...
...
This diff is collapsed.
Click to expand it.
src/backend/parser/gram.c
+
5225
−
5025
View file @
78511d8f
Source diff could not be displayed: it is too large. Options to address this:
view the blob
.
This diff is collapsed.
Click to expand it.
src/backend/parser/parse.h
+
50
−
48
View file @
78511d8f
...
...
@@ -202,54 +202,56 @@ typedef union
#define INSTEAD 428
#define ISNULL 429
#define LANCOMPILER 430
#define LISTEN 431
#define LOAD 432
#define LOCATION 433
#define LOCK_P 434
#define MAXVALUE 435
#define MINVALUE 436
#define MOVE 437
#define NEW 438
#define NOCREATEDB 439
#define NOCREATEUSER 440
#define NONE 441
#define NOTHING 442
#define NOTIFY 443
#define NOTNULL 444
#define OIDS 445
#define OPERATOR 446
#define PASSWORD 447
#define PROCEDURAL 448
#define RECIPE 449
#define RENAME 450
#define RESET 451
#define RETURNS 452
#define ROW 453
#define RULE 454
#define SEQUENCE 455
#define SERIAL 456
#define SETOF 457
#define SHOW 458
#define START 459
#define STATEMENT 460
#define STDIN 461
#define STDOUT 462
#define TRUSTED 463
#define UNLISTEN 464
#define UNTIL 465
#define VACUUM 466
#define VALID 467
#define VERBOSE 468
#define VERSION 469
#define IDENT 470
#define SCONST 471
#define Op 472
#define ICONST 473
#define PARAM 474
#define FCONST 475
#define OP 476
#define UMINUS 477
#define TYPECAST 478
#define LIMIT 431
#define LISTEN 432
#define LOAD 433
#define LOCATION 434
#define LOCK_P 435
#define MAXVALUE 436
#define MINVALUE 437
#define MOVE 438
#define NEW 439
#define NOCREATEDB 440
#define NOCREATEUSER 441
#define NONE 442
#define NOTHING 443
#define NOTIFY 444
#define NOTNULL 445
#define OFFSET 446
#define OIDS 447
#define OPERATOR 448
#define PASSWORD 449
#define PROCEDURAL 450
#define RECIPE 451
#define RENAME 452
#define RESET 453
#define RETURNS 454
#define ROW 455
#define RULE 456
#define SEQUENCE 457
#define SERIAL 458
#define SETOF 459
#define SHOW 460
#define START 461
#define STATEMENT 462
#define STDIN 463
#define STDOUT 464
#define TRUSTED 465
#define UNLISTEN 466
#define UNTIL 467
#define VACUUM 468
#define VALID 469
#define VERBOSE 470
#define VERSION 471
#define IDENT 472
#define SCONST 473
#define Op 474
#define ICONST 475
#define PARAM 476
#define FCONST 477
#define OP 478
#define UMINUS 479
#define TYPECAST 480
extern
YYSTYPE
yylval
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment