Re: [PERFORM] Index Scan Costs versus Sort

2005-11-10 Thread Tom Lane
Charlie Savage [EMAIL PROTECTED] writes: 1. Postgresql estimates the index scan will be 50 times more costly than the seq scan (112870376 vs 2229858) yet in fact it only takes 3 times longer to execute (2312426 s vs. 768403 s). My understanding is that postgresql assumes, via the

Re: [PERFORM] Index Scan Costs versus Sort

2005-11-10 Thread Charlie Savage
Hi Tom, From pg_stats: schema = tiger; tablename = completechain; attname = tlid; null_frac = 0; avg_width = 4; n_distinct = -1; most_common_vals = ; most_common_freqs = ; correlation = 0.155914; Note that I have default_statistics_target set to 100. Here is the first few values from

Re: [PERFORM] Index Scan Costs versus Sort

2005-11-10 Thread Charlie Savage
Following up with some additional information. The machine has 1Gb physical RAM. When I run the query (with sort and seqscan enabled), top reports (numbers are fairly consistent): Mem: 1,032,972k total, 1,019,516k used, 13,412k free, 17,132k buffers Swap: 2,032,140k total, 17,592k used,