Re: Help with tuning this query (with explain analyze finally) - Mailing list pgsql-performance

From Richard Huxton
Subject Re: Help with tuning this query (with explain analyze finally)
Date
Msg-id 42288529.7000803@archonet.com
Whole thread Raw
In response to Re: Help with tuning this query (with explain analyze finally)  ("Ken Egervari" <ken@upfactor.com>)
List pgsql-performance
Ken Egervari wrote:
> Let's say we have 200 users signed into the application at the same
> time. The application refreshes their shipment information automatically
> to make sure it's up to date on the user's screen.  The application will
> execute the query we are trying to tune every 60 seconds for most of
> these users.  Users can set the refresh time to be higher, but 60 is the
> lowest amount so I'm just assuming everyone has it at 60.
>
> Anyway, if you have 200 users logged in, that's 200 queries in the 60
> second period, which is about 3-4 queries every second.

Can you turn the problem around? Calculate what you want for all users
(once every 60 seconds) and stuff those results into a summary table.
Then let the users query the summary table as often as they like (with
the understanding that the figures aren't going to update any faster
than once a minute)
--
   Richard Huxton
   Archonet Ltd

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Query's fast standalone - slow as a subquery.
Next
From: "Ken"
Date:
Subject: Re: Help with tuning this query (with explain analyze finally)