Optimizer cleanup.
This commit is contained in:
parent
8dc2209f71
commit
c873fcdaf4
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.29 1999/02/11 17:03:17 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.30 1999/02/11 17:21:51 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -198,13 +198,13 @@ better_path(Path *new_path, List *unique_paths, bool *is_new)
|
|||||||
* over unsorted keys in the same way.
|
* over unsorted keys in the same way.
|
||||||
*/
|
*/
|
||||||
/* same keys, and new is cheaper, use it */
|
/* same keys, and new is cheaper, use it */
|
||||||
if (((better_key == 0 && better_sort == 0 &&
|
if ((better_key == 0 && better_sort == 0 &&
|
||||||
new_path->path_cost < path->path_cost) ||
|
new_path->path_cost < path->path_cost) ||
|
||||||
|
|
||||||
/* new is better, and cheaper, use it */
|
/* new is better, and cheaper, use it */
|
||||||
((better_key == 1 && better_sort != 2) ||
|
(((better_key == 1 && better_sort != 2) ||
|
||||||
(better_key != 2 && better_sort == 1))) &&
|
(better_key != 2 && better_sort == 1)) &&
|
||||||
new_path->path_cost <= path->path_cost)
|
new_path->path_cost <= path->path_cost))
|
||||||
{
|
{
|
||||||
*is_new = false;
|
*is_new = false;
|
||||||
return new_path;
|
return new_path;
|
||||||
@ -212,13 +212,13 @@ better_path(Path *new_path, List *unique_paths, bool *is_new)
|
|||||||
|
|
||||||
/* same keys, new is more expensive, stop */
|
/* same keys, new is more expensive, stop */
|
||||||
else if
|
else if
|
||||||
(((better_key == 0 && better_sort == 0 &&
|
((better_key == 0 && better_sort == 0 &&
|
||||||
new_path->path_cost >= path->path_cost) ||
|
new_path->path_cost >= path->path_cost) ||
|
||||||
|
|
||||||
/* old is better, and less expensive, stop */
|
/* old is better, and less expensive, stop */
|
||||||
((better_key == 2 && better_sort != 1) ||
|
(((better_key == 2 && better_sort != 1) ||
|
||||||
(better_key != 1 && better_sort == 2))) &&
|
(better_key != 1 && better_sort == 2)) &&
|
||||||
new_path->path_cost >= path->path_cost)
|
new_path->path_cost >= path->path_cost))
|
||||||
{
|
{
|
||||||
*is_new = false;
|
*is_new = false;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user