[Cubicweb] Loading slow a big table using default view
mr.li.jinpeng at gmail.com
Fri Jan 24 11:42:38 CET 2014
I added these codes into "test_big_table/views.py" to remove not useful
facets. I re-created instance and imported all the data. When I click
"DataEntity_plural" see DataEntity, it is still slow. Therefore I added a
ticket for this problem: http://www.cubicweb.org/ticket/3478476
Feel free to answer the question. Thanks in advance.
On Thu, Jan 23, 2014 at 1:41 PM, Vincent Michel
<vincent.michel at logilab.fr>wrote:
> On 23/01/2014 13:33, Sylvain Thénault wrote:
>> On 23 janvier 12:24, Jinpeng Li wrote:
>>> Dear developers,
>>> We found a problem that it is too slow to show a big table using default
>>> view. I wrote a description as below with Markdown description. I hope
>>> the description is clear enough to understand. Don't hesitate to let me
>>> know if you don't understand any part.
>> It's very clear, thank your for that.
>>> We guess that the default view may try to load all the data once and show
>>> only first 40 items. In our real database, we have 10 million data, it
>>> take more than 1 minute to open web page where only first 40 items have
>>> been shown. It would be to better to improve the default view with
>>> limited number data items. If there is another possible reason, please
>>> us know. Thanks in advance.
>> That may be due to the pagination. Anyway this case deserves
>> Would you open a ticket with the very same description you've just sent?
>> thx again, regards,
> I have already seen such issue on large database.
> Among different tricks that may help you:
> * Remove unused facets:
> def registration_callback(vreg):
> # Remove facets
> from cubicweb.web.views.facets import (CWSourceFacet, CreatedByFacet,
> InStateFacet, InGroupFacet,
> ETypeFacet, HasTextFacet)
> * Avoid fetching "modification_date" and sorting by date in large lists.
> You have to change AnyEntity fetch_attrs to remove the
> "modification_date" order,
> as for now it creates the following request on etype list:
> Any X,AA ORDERBY AA DESC WHERE X is [etype], X modification_date AA
> A quick solution is:
> from cubicweb.entities import AnyEntity
> AnyEntity.fetch_attrs = ()
> This should help you.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Cubicweb