![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
-> Sort (cost=nan..nan rows=2023865 width=1257) |
#3
| |||
| |||
|
|
Cott Lang <cott (AT) internetstaff (DOT) com> writes: -> Sort (cost=nan..nan rows=2023865 width=1257) What PG version is this? My recollection is we fixed such a thing quite some time ago ... regards, tom lane |
#4
| |||
| |||
|
Oops, sorry - guess I left that out - 7.4.5. ![]() |
#5
| |||
| |||
|
|
Cott Lang <cott (AT) internetstaff (DOT) com> writes: Oops, sorry - guess I left that out - 7.4.5. ![]() Hmm ... I can't duplicate any misbehavior here. Are you using nondefault values for any planner parameters? (particularly sort_mem, random_page_cost, effective_cache_size) regards, tom lane |
#6
| |||
| |||
|
|
sort_mem = 8192 random_page_cost = 2 effective_cache_size = 3932160 |
#7
| |||
| |||
|
|
Cott Lang <cott (AT) internetstaff (DOT) com> writes: sort_mem = 8192 random_page_cost = 2 effective_cache_size = 3932160 effective_cache_size 30Gb ? Seems a tad high ;-) |

|
However, I set up a dummy test case on 7.4.5 and don't see any overflow. Can you try this exact test case and see if you get a NAN? |
#8
| |||
| |||
|
|
Fiddling with the above values, only setting sort_mem absurdly large easily causes NAN. |
#9
| |||
| |||
|
|
Cott Lang <cott (AT) internetstaff (DOT) 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. |
![]() |
| Thread Tools | |
| Display Modes | |
| |