Search Postgresql Archives

Re: Optimizing Queries Joining Several Views

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jason Long <mailing.lists@xxxxxxxxxxxxxxxx> writes:
> In order to do some complex calculations I have joined several views.
> Each view could join quite a few tables.

> The user is allowed to filter the results with several multi-select
> input fields and this is used in the query as where a.id in
> (:listOfIds).

> This works fine if the user does not filter the results.  These calcs
> for every row in the entire can be calculated in 1-2 seconds.  Certain
> combinations of filters will make the query take up to 4 minutes and
> will freeze the system until it has completed.  Queries without these
> calcs at all, but using the same filters work in a reasonable amount of
> time.

You're much more likely to get useful comments if you provide a concrete
example and EXPLAIN ANALYZE results for the various cases.

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux