Greg Stark <[EMAIL PROTECTED]> writes: > For a hash aggregate would it be possible to rescan the original table > instead of spilling to temporary files?
Sure, but the possible performance gain is finite and the possible performance loss is not. The "original table" could be an extremely expensive join. We'd like to think that the planner gets the input size estimate approximately right and so the amount of extra I/O caused by hash table resizing should normally be minimal. The cases where it is not right are *especially* not likely to be a trivial table scan as you are supposing. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match