← Back to team overview

c2c-oerpscenario team mailing list archive

Re: [Bug 723352] Re: postgres views bad query and or need rework

 

On Monday 28 February 2011, you wrote:
> ** Changed in: openobject-addons
>        Status: New => Triaged

A humble note:
the view in question is a monster (number of SQL lines) so hadn't had the time 
to analyze it.
It may be that such a long query is the best way to go, Postgres is fine 
handling very complex queries. But, my experience has met many-many cases 
where huge queries have contained an unwanted path, for example a CROSS JOIN 
that would scan exponential magnitudes of records.

An advice: treat this case with care. READ it a lot, analyze it, and then 
attempt to change/hack anything.

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/723352

Title:
  postgres views bad query and or need rework

Status in OpenERP Modules (addons):
  Triaged

Bug description:
  On a new database Postgres views work great. Especially in web client
  which is a primary feature of the web client. The dashboards. However,
  over time or if you are a large shop and import many older orders and
  products the queries do not return in a reasonable amount of time and
  the clients time out before they can run. For instance, prime example,
  This is a database query generated by the program

  SELECT "account_invoice_report".id FROM "account_invoice_report" WHERE
  (account_invoice_report.year ilike E'%2011%') AND
  (account_invoice_report.user_id = 1) ORDER BY date desc

  On my database, which has 5,000 products and 10,000 orders, not even
  current but older data. It takes more than 700,000 ms to return this
  query. In this case it is never possible to use the web client or any
  of the views because the query does not return. I believe that the
  views have to be reworked to be useful in any environment that is a
  medium sized company.

  A little more information, I have no database mods, or special changes
  of any kind. I have a clean database with latest sources. I believe
  most of the views, if not all suffer from this issue. Consider the web
  client that heavily depends on postgres views is not usable in this
  condition. Please confirm.



References