From db436adf761bd5cb7990745ceba2959ac4bfca7c Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 21 Aug 1999 03:49:17 +0000 Subject: Major revision of sort-node handling: push knowledge of query sort order down into planner, instead of handling it only at the very top level of the planner. This fixes many things. An explicit sort is now avoided if there is a cheaper alternative (typically an indexscan) not only for ORDER BY, but also for the internal sort of GROUP BY. It works even when there is no other reason (such as a WHERE condition) to consider the indexscan. It works for indexes on functions. It works for indexes on functions, backwards. It's just so cool... CAUTION: I have changed the representation of SortClause nodes, therefore THIS UPDATE BREAKS STORED RULES. You will need to initdb. --- src/include/nodes/execnodes.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/include/nodes/execnodes.h') diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index 3b9cf8a8c9a..132f0526676 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: execnodes.h,v 1.33 1999/07/16 17:07:33 momjian Exp $ + * $Id: execnodes.h,v 1.34 1999/08/21 03:49:08 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -572,6 +572,7 @@ typedef struct MaterialState typedef struct AggState { CommonScanState csstate; /* its first field is NodeTag */ + List *aggs; /* all Aggref nodes in targetlist & quals */ bool agg_done; } AggState; -- cgit v1.2.3