Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit712ea25

Browse files
committed
1. Use qsort for first run
2. Limit number of tuples in leftist trees:- put one tuple from current tree to disk if limit reached;- end run creation if limit reached by nextrun.3. Avoid mergeruns() if first run is single one!
1 parent303f651 commit712ea25

File tree

2 files changed

+261
-86
lines changed

2 files changed

+261
-86
lines changed

‎src/backend/utils/sort/lselect.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/lselect.c,v 1.8 1997/09/12 04:08:46 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/lselect.c,v 1.9 1997/09/18 05:37:30 vadim Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -26,15 +26,6 @@
2626
#include"utils/psort.h"
2727
#include"utils/lselect.h"
2828

29-
#definePUTTUP(TUP,FP) fwrite((char *)TUP, (TUP)->t_len, 1, FP)
30-
31-
/*
32-
*USEMEM- record use of memory
33-
*FREEMEM- record freeing of memory
34-
*/
35-
#defineUSEMEM(context,AMT)context->sortMem -= (AMT)
36-
#defineFREEMEM(context,AMT)context->sortMem += (AMT)
37-
3829
/*
3930
*lmerge- merges two leftist trees into one
4031
*
@@ -149,8 +140,7 @@ gettuple(struct leftist ** treep,
149140
else
150141
*treep=lmerge(tp->lt_left,tp->lt_right,context);
151142

152-
FREEMEM(context,sizeof(structleftist));
153-
FREE(tp);
143+
pfree (tp);
154144
return (tup);
155145
}
156146

@@ -173,7 +163,6 @@ puttuple(struct leftist ** treep,
173163
registerstructleftist*tp;
174164

175165
new1= (structleftist*)palloc((unsigned)sizeof(structleftist));
176-
USEMEM(context,sizeof(structleftist));
177166
new1->lt_dist=1;
178167
new1->lt_devnum=devnum;
179168
new1->lt_tuple=newtuple;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp