Re: db growing out of proportion

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Creager <Robert_Creager(at)LogicalChaos(dot)org>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: db growing out of proportion
Date: 2003-05-31 16:13:12
Message-ID: 20748.1054397592@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-performance

Robert Creager <Robert_Creager(at)LogicalChaos(dot)org> writes:
>> I'm interested to narrow down exactly what was the issue here.

> shared_buffers was 1024, now 8192
> max_fsm_relations was 1000, now 10000
> max_fsm_pages was 20000, now 100000
> wal_buffers was 8, now 16
> sort_mem was 1024, now 64000
> vacuum_mem was 1024, now 64000
> effective_cache_size was 1000, now 100000

> The query is:

> UPDATE obs_v
> SET mag = obs_v.imag + zp.zero_v + cg.color_v * (obs_v.imag - i.imag),
> use = true
> FROM color_group AS cg, zero_pair AS zp, obs_i AS i, files AS f
> WHERE obs_v.star_id = i.star_id
> AND obs_v.file_id = f.file_id
> AND cg.group_id = f.group_id
> AND f.group_id = $group_id
> AND zp.pair_id = f.pair_id

Hm. My best guess is that the increase in sort_mem allowed this query
to use a more efficient join plan. Perhaps the planner switched from
merge to hash join once it thought the hash table would fit in sort_mem;
or maybe the plan didn't change but the executor was able to keep
everything in memory instead of using temp files. The other changes you
mention seem good as general housekeeping, but I doubt they'd have much
direct effect on this query's speed. It'd be interesting to look at
EXPLAIN ANALYZE results for the same query at several different sort_mem
values.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Gerhard Dieringer 2003-05-31 20:16:24 Bug in parser?
Previous Message Tom Lane 2003-05-31 15:43:32 Re: Index speeds up one row table (why)?

Browse pgsql-performance by date

  From Date Subject
Next Message Brian Tarbox 2003-05-31 16:30:40 why Sequencial Scan when selecting on primary key of table?
Previous Message Nikolaus Dilger 2003-05-31 15:07:15 Re: Enabling and Disabling Sequencial Scan