Re: join optimization problem

From: Rod Taylor <rbt(at)rbt(dot)ca>
To: toby(at)lyricist(dot)com(dot)au
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: join optimization problem
Date: 2003-08-03 13:04:11
Message-ID: 1059915851.43336.208.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> thanks for that - I tried it out, fixed the minor typos and it ran at almost
> the same speed! Any other ideas?

Could you post an explain analyze for both queries?

There is always an application change. Add a trigger onto msg that will
bump the date and count on msg_sum when a msg is added. This will
support virtually unlimited msg table growth (any aggregate will
eventually be slow on a large table).

Just be sure to vacuum the msg_sum table regularly (once per 25%
turnover) -- possibly as often as once a minute!

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2003-08-03 16:19:49 Re: join optimization problem
Previous Message Toby Tremayne 2003-08-03 10:21:43 Re: join optimization problem