Re: Problem with query plan - Mailing list pgsql-general

From Tom Lane
Subject Re: Problem with query plan
Date
Msg-id 20812.1098490124@sss.pgh.pa.us
Whole thread Raw
In response to Re: Problem with query plan  (Cott Lang <cott@internetstaff.com>)
Responses Re: Problem with query plan
List pgsql-general
Cott Lang <cott@internetstaff.com> writes:
> Fiddling with the above values, only setting sort_mem absurdly large
> easily causes NAN.

Ah.  I see an overflow case for sort_mem exceeding 1Gb; that's probably
what you tickled.

I've fixed this in HEAD, but it doesn't seem worth back-patching.
If you care, the change in HEAD is

*** src/backend/optimizer/path/costsize.c.orig    Sun Aug 29 01:06:43 2004
--- src/backend/optimizer/path/costsize.c    Fri Oct 22 20:02:39 2004
***************
*** 566,572 ****
      if (nbytes > work_mem_bytes)
      {
          double        npages = ceil(nbytes / BLCKSZ);
!         double        nruns = nbytes / (work_mem_bytes * 2);
          double        log_runs = ceil(LOG6(nruns));
          double        npageaccesses;

--- 566,572 ----
      if (nbytes > work_mem_bytes)
      {
          double        npages = ceil(nbytes / BLCKSZ);
!         double        nruns = (nbytes / work_mem_bytes) * 0.5;
          double        log_runs = ceil(LOG6(nruns));
          double        npageaccesses;


but the variable names have changed since 7.4 so this won't apply
cleanly.

            regards, tom lane

pgsql-general by date:

Previous
From: Mark Harrison
Date:
Subject: combining two queries?
Next
From: Duane Lee - EGOVX
Date:
Subject: Re: combining two queries?