Performance problem

Created on 11 September 2018, about 6 years ago
Updated 23 August 2024, 3 months ago

Problem/Motivation

The first load of the filter, loads all entities. If you put a field that is referenced from a node, you will have a extreme performance problems with a large number of nodes.

Proposed resolution

Avoid loading all entities if you don't set the bundle first.

Remaining tasks

The feature request could be done in a better way but its a quick patch.

User interface changes

πŸ› Bug report
Status

RTBC

Version

2.0

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain jtriguero

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • When there is a lot of published content the view fails when trying to load everything.
    The option that worked for me was to temporarily remove the function getValueOptions() from the /src/Plugin/views/filter/EntityReference.php file.
    In this way the options are not loaded and it does not give an error, however it allows you to select the Target entity bundle and in this way you can filter without problem

  • πŸ‡­πŸ‡ΊHungary tikaszvince

    Attach updated patch for version 2.0.1 β†’

  • πŸ‡©πŸ‡ͺGermany christianadamski Berlin, Germany
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.x + Environment: PHP 8.2 & MySQL 8
    last update over 1 year ago
    2 fail
  • #26 worked for me on 2X version
    even if I had to apply it manually (my mistake?)

  • πŸ‡ΊπŸ‡ΈUnited States caspervoogt

    I was able to apply the patch from #26 (via composer.json). Performance seems OK but I hope a few others can test that as well.

  • πŸ‡¦πŸ‡ΊAustralia jnlar Sydney, Australia

    I can confirm #26 also works, note that there's 2 tests failing however. Not sure on their relevance to this issue.

  • πŸ‡ΊπŸ‡ΈUnited States xeiro

    Confirmed #26 patch applied to 10.1.8 using drupal/verf ^2.0 version for me.

  • πŸ‡ΊπŸ‡ΈUnited States brooke_heaton

    The latest patch isn't resolving the fundamental performance problems for me. The views plugin still appears to try to load WAY WAY too many entities. In my case I'm using nodes referenced on a Paragraph that uses a Relationship. What DOES work for me is to comment out the getValueOptions() function entirely when developing locally. I think the plugin has some fundamental problems that aren't addressed here. Definitely needs a lot more work.

  • πŸ‡ΊπŸ‡ΈUnited States sassafrass

    Confirming that the latest patch fixed the issue for me.

  • Status changed to Needs review 5 months ago
  • πŸ‡¬πŸ‡·Greece vensires

    Since this is a really big issue when first trying to install the module and the patch from #26 actually solves it I set it as "Needs review".

    As for the considerations mentioned in #32, I think that it there is something more to address, it should be done in a follow-up issue.
    But what do the rest of you believe?

  • πŸ‡ΉπŸ‡­Thailand AlfTheCat

    #26 is absolutely great, and thanks to everyone contributing to this issue. For me, the biggest problem was that I had a view controlling the results of the entity reference field, and that was being ignored which caused a UX issue apart from the performance impact. This patch applies cleanly alongside other patches in the queue currently, and fixes the behavior.

  • Status changed to RTBC 4 months ago
  • πŸ‡¬πŸ‡·Greece vensires

    Since we have so many validations that #26 works, I set it as RTBC.

  • πŸ‡ΊπŸ‡¦Ukraine khiminrm

    I agree with #32. On a site with a lot of entities I can't even add and configure the filter. We need some better solution if it's possible.

Production build 0.71.5 2024