[Cubicweb] Loading slow a big table using default view

Jinpeng Li mr.li.jinpeng at gmail.com
Fri Jan 24 11:42:38 CET 2014


Hi,

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.

Best,
Jinpeng


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
>>> that
>>> 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
>>> will
>>> 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
>>> loading
>>> limited number data items.  If there is another possible reason, please
>>> let
>>> us know. Thanks in advance.
>>>
>> That may be due to the pagination. Anyway this case deserves
>> investigation.
>> Would you open a ticket with the very same description you've just sent?
>>
>> thx again, regards,
>>
>>
>
> Hi,
>
> 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)
>     vreg.unregister(CWSourceFacet)
>     vreg.unregister(CreatedByFacet)
>     vreg.unregister(InStateFacet)
>     vreg.unregister(InGroupFacet)
>     vreg.unregister(ETypeFacet)
>     vreg.unregister(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.
>
> Best,
>
> Vincent
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubicweb.org/pipermail/cubicweb/attachments/20140124/c821a53d/attachment-0165.html>


More information about the Cubicweb mailing list