mirror of
https://github.com/postgres/postgres.git
synced 2025-10-27 00:12:01 +03:00
Change hash index creation so that rather than always establishing exactly
two buckets at the start, we create a number of buckets appropriate for the estimated size of the table. This avoids a lot of expensive bucket-split actions during initial index build on an already-populated table. This is one of the two core ideas of Tom Raney and Shreya Bhargava's patch to reduce hash index build time. I'm committing it separately to make it easier for people to test the effects of this separately from the effects of their other core idea (pre-sorting the index entries by bucket number).
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/optimizer/plancat.h,v 1.47 2008/01/01 19:45:58 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/include/optimizer/plancat.h,v 1.48 2008/03/15 20:46:31 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -15,6 +15,7 @@
|
||||
#define PLANCAT_H
|
||||
|
||||
#include "nodes/relation.h"
|
||||
#include "utils/rel.h"
|
||||
|
||||
/* Hook for plugins to get control in get_relation_info() */
|
||||
typedef void (*get_relation_info_hook_type) (PlannerInfo *root,
|
||||
@@ -27,6 +28,9 @@ extern PGDLLIMPORT get_relation_info_hook_type get_relation_info_hook;
|
||||
extern void get_relation_info(PlannerInfo *root, Oid relationObjectId,
|
||||
bool inhparent, RelOptInfo *rel);
|
||||
|
||||
extern void estimate_rel_size(Relation rel, int32 *attr_widths,
|
||||
BlockNumber *pages, double *tuples);
|
||||
|
||||
extern bool relation_excluded_by_constraints(RelOptInfo *rel,
|
||||
RangeTblEntry *rte);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user