From fa92d21a486de868b21bbc03944649af3e1ac90f Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 15 Apr 2007 20:09:28 +0000 Subject: Avoid running build_index_pathkeys() in situations where there cannot possibly be any useful pathkeys --- to wit, queries with neither any join clauses nor any ORDER BY request. It's nearly free to check for this case and it saves a useful fraction of the planning time for simple queries. --- src/include/optimizer/paths.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/include/optimizer') diff --git a/src/include/optimizer/paths.h b/src/include/optimizer/paths.h index 6b985e24cd7..c7b8d8c7521 100644 --- a/src/include/optimizer/paths.h +++ b/src/include/optimizer/paths.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/optimizer/paths.h,v 1.96 2007/02/16 00:14:01 tgl Exp $ + * $PostgreSQL: pgsql/src/include/optimizer/paths.h,v 1.97 2007/04/15 20:09:28 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -176,5 +176,6 @@ extern int pathkeys_useful_for_ordering(PlannerInfo *root, List *pathkeys); extern List *truncate_useless_pathkeys(PlannerInfo *root, RelOptInfo *rel, List *pathkeys); +extern bool has_useful_pathkeys(PlannerInfo *root, RelOptInfo *rel); #endif /* PATHS_H */ -- cgit v1.2.3