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

Commit529db99

Browse files
committed
Avoid overflow in cost_sort when work_mem exceeds 1Gb.
1 parent6e3cc20 commit529db99

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/backend/optimizer/path/costsize.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
* Portions Copyright (c) 1994, Regents of the University of California
5050
*
5151
* IDENTIFICATION
52-
* $PostgreSQL: pgsql/src/backend/optimizer/path/costsize.c,v 1.134 2004/08/2905:06:43 momjian Exp $
52+
* $PostgreSQL: pgsql/src/backend/optimizer/path/costsize.c,v 1.135 2004/10/23 00:05:27 tgl Exp $
5353
*
5454
*-------------------------------------------------------------------------
5555
*/
@@ -566,7 +566,7 @@ cost_sort(Path *path, Query *root,
566566
if (nbytes>work_mem_bytes)
567567
{
568568
doublenpages=ceil(nbytes /BLCKSZ);
569-
doublenruns=nbytes /(work_mem_bytes*2);
569+
doublenruns=(nbytes /work_mem_bytes)*0.5;
570570
doublelog_runs=ceil(LOG6(nruns));
571571
doublenpageaccesses;
572572

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp