PostgreSQL Source Code: src/backend/access/hash/hashsort.c Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

27

34

35

36

37

38

40{

43

44

45

46

47

48

49

53};

54

55

56

57

58

61{

63

65

66

67

68

69

70

71

72

73

77

78

79

80

81

82

89 NULL,

91

92 return hspool;

93}

94

95

96

97

98void

100{

103}

104

105

106

107

108void

110{

112 self, values, isnull);

113}

114

115

116

117

118

119void

121{

123 int64 tups_done = 0;

124#ifdef USE_ASSERT_CHECKING

126#endif

127

129

131 {

132

133

134

135

136

137

138

139#ifdef USE_ASSERT_CHECKING

140 uint32 lasthashkey = hashkey;

141

145 Assert(hashkey >= lasthashkey);

146#endif

147

148

150

151

153

155 ++tups_done);

156 }

157}

void pgstat_progress_update_param(int index, int64 val)

static Datum values[MAXATTR]

Assert(PointerIsAligned(start, uint64))

void _hash_doinsert(Relation rel, IndexTuple itup, Relation heapRel, bool sorted)

void _h_spool(HSpool *hspool, ItemPointer self, const Datum *values, const bool *isnull)

void _h_indexbuild(HSpool *hspool, Relation heapRel)

HSpool * _h_spoolinit(Relation heap, Relation index, uint32 num_buckets)

void _h_spooldestroy(HSpool *hspool)

uint32 _hash_get_indextuple_hashkey(IndexTuple itup)

Bucket _hash_hashkey2bucket(uint32 hashkey, uint32 maxbucket, uint32 highmask, uint32 lowmask)

void pfree(void *pointer)

void * palloc0(Size size)

#define CHECK_FOR_INTERRUPTS()

static uint32 pg_nextpower2_32(uint32 num)

#define PROGRESS_CREATEIDX_TUPLES_DONE

Tuplesortstate * sortstate

void tuplesort_performsort(Tuplesortstate *state)

void tuplesort_end(Tuplesortstate *state)

IndexTuple tuplesort_getindextuple(Tuplesortstate *state, bool forward)

void tuplesort_putindextuplevalues(Tuplesortstate *state, Relation rel, ItemPointer self, const Datum *values, const bool *isnull)

Tuplesortstate * tuplesort_begin_index_hash(Relation heapRel, Relation indexRel, uint32 high_mask, uint32 low_mask, uint32 max_buckets, int workMem, SortCoordinate coordinate, int sortopt)