Cleanup of OR processing.

This commit is contained in:
Bruce Momjian 1998-08-03 05:49:24 +00:00
parent 7665e7b0a8
commit b88e9784b6
4 changed files with 144 additions and 147 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.22 1998/08/02 07:10:38 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.23 1998/08/03 05:49:19 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -307,17 +307,23 @@ match_index_orclause(RelOptInfo *rel,
List *other_matching_indices)
{
Node *clause = NULL;
List *matched_indices;
List *matching_indices = other_matching_indices;
List *index_list = NIL;
List *clist;
/* first time through, we create index list */
if (!other_matching_indices)
{
foreach(clist, or_clauses)
matching_indices = lcons(NIL, matching_indices);
}
else matching_indices = other_matching_indices;
index_list = matching_indices;
foreach(clist, or_clauses)
{
clause = lfirst(clist);
if (other_matching_indices)
matched_indices = lfirst(other_matching_indices);
else
matched_indices = NIL;
if (is_opclause(clause) &&
op_class(((Oper *) ((Expr *) clause)->oper)->opno,
@ -333,14 +339,10 @@ match_index_orclause(RelOptInfo *rel,
index) &&
IsA(get_rightop((Expr *) clause), Const))))
{
matched_indices = lcons(index, matched_indices);
lfirst(matching_indices) = lcons(index, lfirst(matching_indices));
}
/* for the first index, we are creating the indexids list */
index_list = lappend(index_list, matched_indices);
if (other_matching_indices)
other_matching_indices = lnext(other_matching_indices);
matching_indices = lnext(matching_indices);
}
return (index_list);

View File

@ -3,141 +3,136 @@ Landscape
Center
Inches
1200 2
2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5
6900 1200 6900 600 4500 600 4500 1200 6900 1200
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2
6 450 375 2250 1575
4 0 -1 0 0 0 24 0.0000 4 255 735 450 1515 Flow\001
4 0 -1 0 0 0 24 0.0000 4 330 1800 450 675 PostgreSQL\001
4 0 -1 0 0 0 24 0.0000 4 330 1290 450 1095 Program\001
-6
6 5325 13125 7725 14400
2 4 0 1 -1 29 0 0 20 0.000 0 0 7 0 0 5
7725 14400 5325 14400 5325 13800 7725 13800 7725 14400
2 1 0 1 29 7 0 0 -1 0.000 0 0 -1 1 1 2
0 0 1.00 60.00 120.00
5700 1200 5700 1800
2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5
6900 2400 6900 1800 4500 1800 4500 2400 6900 2400
2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5
6900 3600 6900 3000 4500 3000 4500 3600 6900 3600
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00
5700 2400 5700 3000
2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5
10800 3600 10800 3000 8400 3000 8400 3600 10800 3600
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00
5700 2400 9600 3000
2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5
6900 5100 6900 4500 4500 4500 4500 5100 6900 5100
2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5
6900 6300 6900 5700 4500 5700 4500 6300 6900 6300
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00
5700 5100 5700 5700
2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5
6900 7500 6900 6900 4500 6900 4500 7500 6900 7500
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00
5700 6300 5700 6900
2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5
6900 8700 6900 8100 4500 8100 4500 8700 6900 8700
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00
5700 7500 5700 8100
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00
5700 8700 5700 9300
2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5
10800 6300 10800 5700 8400 5700 8400 6300 10800 6300
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00
6900 6000 8400 6000
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 3
0 0 1.00 60.00 120.00
4500 9600 3900 9600 3900 6600
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1
2700 8100
6450 13200 6450 13800
-6
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1
8475 2175
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1
8475 2175
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00
3900 6600 3900 4200
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00
3900 4200 5700 4200
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00
5700 4200 5700 4500
2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5
2700 9600 2700 9000 300 9000 300 9600 2700 9600
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 1 2
2 4 0 1 -1 29 0 0 20 0.000 0 0 7 0 0 5
2850 13200 450 13200 450 12600 2850 12600 2850 13200
2 1 0 1 29 7 0 0 -1 0.000 0 0 -1 1 1 2
0 0 1.00 60.00 120.00
0 0 1.00 60.00 120.00
2700 9300 3300 9300
2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5
2700 8700 2700 8100 300 8100 300 8700 2700 8700
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 1 2
1650 12600 1650 12000
2 4 0 1 -1 29 0 0 20 0.000 0 0 7 0 0 5
9225 13200 6825 13200 6825 12600 9225 12600 9225 13200
2 1 0 1 29 7 0 0 -1 0.000 0 0 -1 1 1 2
0 0 1.00 60.00 120.00
0 0 1.00 60.00 120.00
2700 8400 3300 8400
2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5
2700 7800 2700 7200 300 7200 300 7800 2700 7800
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 1 2
8025 11925 8025 12525
2 4 0 1 -1 29 0 0 20 0.000 0 0 7 0 0 5
6000 13200 3600 13200 3600 12600 6000 12600 6000 13200
2 1 0 1 29 7 0 0 -1 0.000 0 0 -1 1 1 2
0 0 1.00 60.00 120.00
0 0 1.00 60.00 120.00
3300 7500 2700 7500
2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5
2700 6900 2700 6300 300 6300 300 6900 2700 6900
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 1 2
4800 12600 4800 12000
2 4 0 1 -1 29 0 0 20 0.000 0 0 7 0 0 5
4425 14400 2025 14400 2025 13800 4425 13800 4425 14400
2 1 0 1 29 7 0 0 -1 0.000 0 0 -1 1 1 2
0 0 1.00 60.00 120.00
0 0 1.00 60.00 120.00
3300 6600 2700 6600
2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5
2700 6000 2700 5400 300 5400 300 6000 2700 6000
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 1 2
3225 13200 3225 13800
2 1 0 1 8 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00
2625 6675 2625 7275
2 1 0 1 19 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00
2625 2775 2625 3375
2 4 0 1 -1 4 0 0 20 0.000 0 0 7 0 0 5
3825 3975 1425 3975 1425 3375 3825 3375 3825 3975
2 1 0 1 20 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00
2625 3975 2625 4575
2 1 0 1 20 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00
2625 3975 6525 4575
2 4 0 1 -1 8 0 0 20 0.000 0 0 7 0 0 5
3825 6675 1425 6675 1425 6075 3825 6075 3825 6675
2 4 0 1 -1 8 0 0 20 0.000 0 0 7 0 0 5
3825 7875 1425 7875 1425 7275 3825 7275 3825 7875
2 4 0 1 -1 8 0 0 20 0.000 0 0 7 0 0 5
3825 9075 1425 9075 1425 8475 3825 8475 3825 9075
2 1 0 1 8 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00
2625 7875 2625 8475
2 4 0 1 -1 8 0 0 20 0.000 0 0 7 0 0 5
3825 10275 1425 10275 1425 9675 3825 9675 3825 10275
2 1 0 1 8 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00
2625 9075 2625 9675
2 1 0 1 8 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00
2625 10275 2625 10875
2 4 0 1 -1 8 0 0 20 0.000 0 0 7 0 0 5
7725 7875 5325 7875 5325 7275 7725 7275 7725 7875
2 1 0 1 8 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00
3825 7575 5325 7575
2 1 0 1 8 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00
2625 5775 2625 6075
2 4 0 1 -1 8 0 0 20 0.000 0 0 7 0 0 5
3825 11475 1425 11475 1425 10875 3825 10875 3825 11475
2 1 0 1 31 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00
2625 5175 2625 5775
2 4 0 1 -1 31 0 0 20 0.000 0 0 7 0 0 5
3825 5175 1425 5175 1425 4575 3825 4575 3825 5175
2 4 0 1 -1 31 0 0 20 0.000 0 0 7 0 0 5
7725 5175 5325 5175 5325 4575 7725 4575 7725 5175
2 4 0 1 -1 17 1 0 20 0.000 0 0 40 0 0 5
8775 11775 375 11775 375 5625 8775 5625 8775 11775
2 4 0 1 -1 0 0 0 20 0.000 0 0 7 0 0 5
7725 3375 5325 3375 5325 2775 7725 2775 7725 3375
2 1 1 1 -1 7 0 0 -1 3.000 0 0 -1 1 1 2
0 0 1.00 60.00 120.00
0 0 1.00 60.00 120.00
2700 5700 3300 5700
2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5
6900 9900 6900 9300 4500 9300 4500 9900 6900 9900
2 4 0 1 -1 7 0 0 -1 0.000 0 0 8 0 0 5
10800 1200 10800 600 8400 600 8400 1200 10800 1200
2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5
10800 2400 10800 1800 8400 1800 8400 2400 10800 2400
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 1 2
4660 3324 5295 3093
2 1 1 1 -1 7 0 0 -1 4.000 0 0 -1 1 1 2
0 0 1.00 60.00 120.00
0 0 1.00 60.00 120.00
8400 2100 7725 2100
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 1 2
4890 3708 5325 3150
2 4 0 1 -1 26 0 0 20 0.000 0 0 7 0 0 5
3825 2775 1425 2775 1425 2175 3825 2175 3825 2775
2 4 0 1 -1 23 0 0 20 0.000 0 0 8 0 0 5
2925 15675 525 15675 525 15075 2925 15075 2925 15675
3 0 0 1 8 7 0 0 -1 0.000 0 1 0 5
0 0 1.00 60.00 120.00
7725 7575 8325 7275 8325 6375 7950 5775 2625 5775
3 0 0 1 8 7 0 0 -1 0.000 0 1 0 5
0 0 1.00 60.00 120.00
8325 2175 7725 2550
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00
5700 3600 5700 4200
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 3
0 0 1.00 60.00 120.00
10800 6000 11400 6000 11400 4200
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00
11400 4200 5700 4200
4 1 -1 0 0 28 18 0.0000 4 195 630 5670 990 Main\001
4 1 -1 0 0 28 18 0.0000 4 195 1470 5685 2190 Postmaster\001
4 1 -1 0 0 28 18 0.0000 4 240 1110 9585 3375 Postgres\001
4 1 -1 0 0 28 18 0.0000 4 240 1110 5700 3390 Postgres\001
4 1 -1 0 0 28 18 0.0000 4 195 1980 5685 7455 Generate Paths\001
4 1 -1 0 0 28 18 0.0000 4 195 1275 5715 7170 Rewrite &\001
4 1 -1 0 0 28 18 0.0000 4 255 1500 5715 6090 Traffic Cop\001
4 1 -1 0 0 28 18 0.0000 4 195 825 5685 4875 Parser\001
4 1 -1 0 0 28 18 0.0000 4 195 1485 9600 6255 Commands\001
4 1 -1 0 0 28 18 0.0000 4 195 1830 5715 8670 Generate Plan\001
4 1 -1 0 0 28 18 0.0000 4 195 1890 5700 8400 Choose Path &\001
4 1 -1 0 0 28 18 0.0000 4 240 1125 5715 6660 complex\001
4 0 -1 0 0 0 24 0.0000 4 330 1290 600 1470 Program\001
4 0 -1 0 0 0 24 0.0000 4 255 735 600 1890 Flow\001
4 0 -1 0 0 0 24 0.0000 4 330 1800 600 1050 PostgreSQL\001
4 0 -1 0 0 0 18 0.0000 4 255 1095 9000 975 Bootstrap\001
4 1 -1 0 0 28 18 0.0000 4 240 2325 1515 9390 Storage Managers\001
4 0 -1 0 0 0 18 0.0000 4 225 1425 750 8475 Nodes / Lists\001
4 1 -1 0 0 28 18 0.0000 4 195 1050 1485 7590 Utilities\001
4 1 -1 0 0 28 18 0.0000 4 195 2100 1485 5805 Access Methods\001
4 1 -1 0 0 28 18 0.0000 4 195 1140 5685 9720 Executor\001
4 0 -1 0 0 0 18 0.0000 4 255 645 9225 2175 Libpq\001
4 0 -1 0 0 0 18 0.0000 4 255 840 1050 6675 Catalog\001
4 1 -1 0 0 28 18 0.0000 4 240 795 7605 5925 utility\001
4 1 -1 0 0 28 18 0.0000 4 240 825 9600 5970 Utility\001
1425 11175 750 10725 750 6225 1425 5775 2625 5775
4 1 -1 0 0 28 18 0.0000 4 195 1050 1635 12990 Utilities\001
4 1 -1 0 0 28 18 0.0000 4 240 2325 8040 12990 Storage Managers\001
4 1 -1 0 0 0 18 0.0000 4 255 840 4800 12975 Catalog\001
4 1 -1 0 0 28 18 0.0000 4 195 2100 3210 14205 Access Methods\001
4 1 7 0 0 28 18 0.0000 4 195 1980 2610 9030 Generate Paths\001
4 1 7 0 0 28 18 0.0000 4 195 1485 6525 7830 Commands\001
4 1 7 0 0 28 18 0.0000 4 195 1830 2640 10245 Generate Plan\001
4 1 -1 0 0 28 18 0.0000 4 195 1470 2610 3765 Postmaster\001
4 1 -1 0 0 28 18 0.0000 4 240 1110 6510 4950 Postgres\001
4 1 -1 0 0 28 18 0.0000 4 240 1110 2625 4965 Postgres\001
4 1 7 0 0 28 18 0.0000 4 195 1275 2640 8745 Rewrite &\001
4 1 7 0 0 28 18 0.0000 4 255 1500 2640 7665 Traffic Cop\001
4 1 7 0 0 28 18 0.0000 4 195 825 2610 6450 Parser\001
4 1 7 0 0 28 18 0.0000 4 195 1890 2625 9975 Choose Path &\001
4 1 7 0 0 28 18 0.0000 4 195 1140 2610 11295 Executor\001
4 1 8 0 0 28 18 0.0000 4 240 795 4530 7500 utility\001
4 1 7 0 0 28 18 0.0000 4 240 825 6525 7545 Utility\001
4 1 -1 0 0 28 18 0.0000 4 195 630 2595 2565 Main\001
4 1 8 0 0 28 18 0.0000 4 240 1125 2640 8235 complex\001
4 1 -1 0 0 0 18 0.0000 4 225 1425 6525 14175 Nodes / Lists\001
4 1 7 0 0 0 18 0.0000 4 255 645 6525 3150 Libpq\001
4 1 -1 0 0 0 18 0.0000 4 255 1095 1725 15450 Bootstrap\001

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 72 KiB

View File

@ -20,23 +20,23 @@ Click on an item to see more detail or look at the full
<IMG src="flow.jpg" usemap="#flowmap" alt="flowchart">
</CENTER>
<MAP name="flowmap">
<AREA COORDS="290,10,450,50" HREF="backend_dirs.html#main">
<AREA COORDS="550,10,710,50" HREF="backend_dirs.html#bootstrap">
<AREA COORDS="290,90,450,130," HREF="backend_dirs.html#postmaster">
<AREA COORDS="550,90,710,130," HREF="backend_dirs.html#libpq">
<AREA COORDS="290,170,450,210" HREF="backend_dirs.html#tcop">
<AREA COORDS="550,170,710,210" HREF="backend_dirs.html#tcop">
<AREA COORDS="290,270,450,310" HREF="backend_dirs.html#parser">
<AREA COORDS="290,350,450,390" HREF="backend_dirs.html#tcop">
<AREA COORDS="290,430,450,470" HREF="backend_dirs.html#optimizer">
<AREA COORDS="290,510,450,550" HREF="backend_dirs.html#optimizer/plan">
<AREA COORDS="290,570,450,630" HREF="backend_dirs.html#executor">
<AREA COORDS="550,350,710,390" HREF="backend_dirs.html#commands">
<AREA COORDS="10,330,170,370" HREF="backend_dirs.html#access">
<AREA COORDS="10,390,170,430" HREF="backend_dirs.html#catalog">
<AREA COORDS="10,450,170,490" HREF="backend_dirs.html#utils">
<AREA COORDS="10,510,170,550" HREF="backend_dirs.html#nodes">
<AREA COORDS="10,570,170,610" HREF="backend_dirs.html#storage">
<AREA COORDS="80,130,240,170" HREF="backend_dirs.html#main">
<AREA COORDS="80,210,240,250" HREF="backend_dirs.html#postmaster">
<AREA COORDS="340,170,500,210" HREF="backend_dirs.html#libpq">
<AREA COORDS="80,290,240,330" HREF="backend_dirs.html#tcop">
<AREA COORDS="340,290,500,330" HREF="backend_dirs.html#tcop">
<AREA COORDS="80,390,240,430" HREF="backend_dirs.html#parser">
<AREA COORDS="80,470,240,510" HREF="backend_dirs.html#tcop">
<AREA COORDS="80,550,240,590" HREF="backend_dirs.html#optimizer">
<AREA COORDS="80,530,240,670" HREF="backend_dirs.html#optimizer/plan">
<AREA COORDS="80,710,240,750" HREF="backend_dirs.html#executor">
<AREA COORDS="340,470,500,510" HREF="backend_dirs.html#commands">
<AREA COORDS="10,820,170,870" HREF="backend_dirs.html#utils">
<AREA COORDS="220,820,380,860" HREF="backend_dirs.html#catalog">
<AREA COORDS="430,820,600,870" HREF="backend_dirs.html#storage">
<AREA COORDS="110,900,280,950" HREF="backend_dirs.html#access">
<AREA COORDS="340,900,500,950" HREF="backend_dirs.html#nodes">
<AREA COORDS="20,990,180,1030" HREF="backend_dirs.html#bootstrap">
</MAP>
<BR>
<P>