Jan Dittmer <[EMAIL PROTECTED]> escreveu: What is your work_mem setting? I think the default is 1MB which isprobably too low as your trying to sort roughly 15*100Bytes = 15MB.Jan I think you would like to say 15*896Bytes... Am I right? My default work_mem is 2048 and I changed to 20..
I´m not sure but I think the extra runtime of the select statement that has the ORDER BY clause is because the planner decided to sort the result set. Is the sort really necessary? Why not only scanning the primary key index pages and retrieving the rows like the select without the order by cla
I restored the table in another database and repeated the analyze again with original column definitions (numeric): With order by: Sort (cost=212634.30..213032.73 rows=159374 width=897) (actual time=9286.817..9865.030 rows=167710 loops=1) Sort Key: anocalc, cadastro, codvencto, parcela ->
Carlos Benkendorf <[EMAIL PROTECTED]> writes:
> Table "iparq.arript"
> Column | Type | Modifiers
> ---+---+---
> anocalc | numeric(4,0) | not null
> cadastro | numeric(8,0)