@@ -334,11 +334,11 @@ struct PlannerInfo
334
334
335
335
MemoryContext planner_cxt ;/* context holding PlannerInfo */
336
336
337
- double total_table_pages ;/* # of pages in all non-dummy tables of
337
+ Cardinality total_table_pages ;/* # of pages in all non-dummy tables of
338
338
* query */
339
339
340
- double tuple_fraction ;/* tuple_fraction passed to query_planner */
341
- double limit_tuples ;/* limit_tuples passed to query_planner */
340
+ Selectivity tuple_fraction ;/* tuple_fraction passed to query_planner */
341
+ Cardinality limit_tuples ;/* limit_tuples passed to query_planner */
342
342
343
343
Index qual_security_level ;/* minimum security_level for quals */
344
344
/* Note: qual_security_level is zero if there are no securityQuals */
@@ -681,7 +681,7 @@ typedef struct RelOptInfo
681
681
Relids relids ;/* set of base relids (rangetable indexes) */
682
682
683
683
/* size estimates generated by planner */
684
- double rows ;/* estimated number of result tuples */
684
+ Cardinality rows ;/* estimated number of result tuples */
685
685
686
686
/* per-relation planner control flags */
687
687
bool consider_startup ;/* keep cheap-startup-cost paths? */
@@ -718,7 +718,7 @@ typedef struct RelOptInfo
718
718
List * indexlist ;/* list of IndexOptInfo */
719
719
List * statlist ;/* list of StatisticExtInfo */
720
720
BlockNumber pages ;/* size estimates derived from pg_class */
721
- double tuples ;
721
+ Cardinality tuples ;
722
722
double allvisfrac ;
723
723
Bitmapset * eclass_indexes ;/* Indexes in PlannerInfo's eq_classes list of
724
724
* ECs that mention this rel */
@@ -841,7 +841,7 @@ struct IndexOptInfo
841
841
842
842
/* index-size statistics (from pg_class and elsewhere) */
843
843
BlockNumber pages ;/* number of disk pages in index */
844
- double tuples ;/* number of index tuples in index */
844
+ Cardinality tuples ;/* number of index tuples in index */
845
845
int tree_height ;/* index tree height, or -1 if unknown */
846
846
847
847
/* index descriptor information */
@@ -1139,7 +1139,7 @@ typedef struct ParamPathInfo
1139
1139
NodeTag type ;
1140
1140
1141
1141
Relids ppi_req_outer ;/* rels supplying parameters used by path */
1142
- double ppi_rows ;/* estimated number of result tuples */
1142
+ Cardinality ppi_rows ;/* estimated number of result tuples */
1143
1143
List * ppi_clauses ;/* join clauses available from outer rels */
1144
1144
}ParamPathInfo ;
1145
1145
@@ -1189,7 +1189,7 @@ typedef struct Path
1189
1189
int parallel_workers ;/* desired # of workers; 0 = not parallel */
1190
1190
1191
1191
/* estimated size/costs for path (see costsize.c for more info) */
1192
- double rows ;/* estimated number of result tuples */
1192
+ Cardinality rows ;/* estimated number of result tuples */
1193
1193
Cost startup_cost ;/* cost expended before fetching any tuples */
1194
1194
Cost total_cost ;/* total cost (assuming all tuples fetched) */
1195
1195
@@ -1452,7 +1452,7 @@ typedef struct AppendPath
1452
1452
List * subpaths ;/* list of component Paths */
1453
1453
/* Index of first partial path in subpaths; list_length(subpaths) if none */
1454
1454
int first_partial_path ;
1455
- double limit_tuples ;/* hard limit on output tuples, or -1 */
1455
+ Cardinality limit_tuples ;/* hard limit on output tuples, or -1 */
1456
1456
}AppendPath ;
1457
1457
1458
1458
#define IS_DUMMY_APPEND (p ) \
@@ -1474,7 +1474,7 @@ typedef struct MergeAppendPath
1474
1474
{
1475
1475
Path path ;
1476
1476
List * subpaths ;/* list of component Paths */
1477
- double limit_tuples ;/* hard limit on output tuples, or -1 */
1477
+ Cardinality limit_tuples ;/* hard limit on output tuples, or -1 */
1478
1478
}MergeAppendPath ;
1479
1479
1480
1480
/*
@@ -1515,7 +1515,7 @@ typedef struct MemoizePath
1515
1515
List * param_exprs ;/* cache keys */
1516
1516
bool singlerow ;/* true if the cache entry is to be marked as
1517
1517
* complete after caching the first record. */
1518
- double calls ;/* expected number of rescans */
1518
+ Cardinality calls ;/* expected number of rescans */
1519
1519
uint32 est_entries ;/* The maximum number of entries that the
1520
1520
* planner expects will fit in the cache, or 0
1521
1521
* if unknown */
@@ -1667,7 +1667,7 @@ typedef struct HashPath
1667
1667
JoinPath jpath ;
1668
1668
List * path_hashclauses ;/* join clauses used for hashing */
1669
1669
int num_batches ;/* number of batches expected */
1670
- double inner_rows_total ;/* total inner rows expected */
1670
+ Cardinality inner_rows_total ;/* total inner rows expected */
1671
1671
}HashPath ;
1672
1672
1673
1673
/*
@@ -1770,7 +1770,7 @@ typedef struct AggPath
1770
1770
Path * subpath ;/* path representing input source */
1771
1771
AggStrategy aggstrategy ;/* basic strategy, see nodes.h */
1772
1772
AggSplit aggsplit ;/* agg-splitting mode, see nodes.h */
1773
- double numGroups ;/* estimated number of groups in input */
1773
+ Cardinality numGroups ;/* estimated number of groups in input */
1774
1774
uint64 transitionSpace ;/* for pass-by-ref transition data */
1775
1775
List * groupClause ;/* a list of SortGroupClause's */
1776
1776
List * qual ;/* quals (HAVING quals), if any */
@@ -1784,7 +1784,7 @@ typedef struct GroupingSetData
1784
1784
{
1785
1785
NodeTag type ;
1786
1786
List * set ;/* grouping set as list of sortgrouprefs */
1787
- double numGroups ;/* est. number of result groups */
1787
+ Cardinality numGroups ;/* est. number of result groups */
1788
1788
}GroupingSetData ;
1789
1789
1790
1790
typedef struct RollupData
@@ -1793,7 +1793,7 @@ typedef struct RollupData
1793
1793
List * groupClause ;/* applicable subset of parse->groupClause */
1794
1794
List * gsets ;/* lists of integer indexes into groupClause */
1795
1795
List * gsets_data ;/* list of GroupingSetData */
1796
- double numGroups ;/* est. number of result groups */
1796
+ Cardinality numGroups ;/* est. number of result groups */
1797
1797
bool hashable ;/* can be hashed */
1798
1798
bool is_hashed ;/* to be implemented as a hashagg */
1799
1799
}RollupData ;
@@ -1844,7 +1844,7 @@ typedef struct SetOpPath
1844
1844
List * distinctList ;/* SortGroupClauses identifying target cols */
1845
1845
AttrNumber flagColIdx ;/* where is the flag column, if any */
1846
1846
int firstFlag ;/* flag value for first input relation */
1847
- double numGroups ;/* estimated number of groups in input */
1847
+ Cardinality numGroups ;/* estimated number of groups in input */
1848
1848
}SetOpPath ;
1849
1849
1850
1850
/*
@@ -1857,7 +1857,7 @@ typedef struct RecursiveUnionPath
1857
1857
Path * rightpath ;
1858
1858
List * distinctList ;/* SortGroupClauses identifying target cols */
1859
1859
int wtParam ;/* ID of Param representing work table */
1860
- double numGroups ;/* estimated number of groups in input */
1860
+ Cardinality numGroups ;/* estimated number of groups in input */
1861
1861
}RecursiveUnionPath ;
1862
1862
1863
1863
/*
@@ -2612,7 +2612,7 @@ typedef struct
2612
2612
typedef struct
2613
2613
{
2614
2614
bool limit_needed ;
2615
- double limit_tuples ;
2615
+ Cardinality limit_tuples ;
2616
2616
int64 count_est ;
2617
2617
int64 offset_est ;
2618
2618
}FinalPathExtraData ;
@@ -2643,15 +2643,15 @@ typedef struct JoinCostWorkspace
2643
2643
Cost inner_rescan_run_cost ;
2644
2644
2645
2645
/* private for cost_mergejoin code */
2646
- double outer_rows ;
2647
- double inner_rows ;
2648
- double outer_skip_rows ;
2649
- double inner_skip_rows ;
2646
+ Cardinality outer_rows ;
2647
+ Cardinality inner_rows ;
2648
+ Cardinality outer_skip_rows ;
2649
+ Cardinality inner_skip_rows ;
2650
2650
2651
2651
/* private for cost_hashjoin code */
2652
2652
int numbuckets ;
2653
2653
int numbatches ;
2654
- double inner_rows_total ;
2654
+ Cardinality inner_rows_total ;
2655
2655
}JoinCostWorkspace ;
2656
2656
2657
2657
/*