Okay
  Public Ticket #1942493
Filtering not working
Closed

Comments

  • bmwork started the conversation

    Hello,

    We've got PostgreSQL database as data source. Data outputs for the app sometimes exceed 2500 rows.

    And there is a problem with filters, when table exceeds 2000 rows and Server-side processing is active.

    While searching for solution we found this post:  https://tmsplugins.ticksy.com/ticket/1526938/

    It could data from query, view, materialized view or directly from sql table - problem's unsolved when data output exceeds 2000 rows.

    I've tried with a subset of ~1.9k rows and no Server-side, and it works fine then.

    Attached, you will find 2 screens - the same amount of data, differs only with 'Server-Side' on.

    Looking forward to seeing from you soon. The case is urgent as we're working on prod solution for our Clients.

    BR,

    Marek & Bartek



  •  2,572
    Aleksandar replied

    Hello Marek & Bartek.

    The SQL query based table sometimes doesn’t work correctly with server-side processing, yes. Most likely, this is happening because wpDataTables server has problems with parsing of the query and building new queries dynamically. MySQL view would need to be prepared to work around the issue.

    Please note that MySQL query constructor is not an ‘ultimate generator’, it should be treated as helper for constructing a suggestion of a query, by trying to ‘guess’ what you want. We are constantly working to improve it, but SQL is such a complicated and flexible language that fully automating the process for constructing queries is hardly possible. Consequently, the more complicated your request is, the higher is the probability that it will not return exactly what you need.

    Please note some this when working with the server-side processing feature:

    • Please do not use “LIMIT” in the SELECT statement. wpDataTables adds it automatically and it will be overridden.
    • Please do not use “ORDER BY” in the SELECT statement. wpDataTables has its own sorting engine so it makes no sense to use MySQL’s sorting, since it will be overridden. Also, server-side processing feature adds this part of statement automatically when users trigger the sorting on the front-end, and having it in initial statement may cause the table to crash.

    We have users that have prepared views for tables that consist of around million of entries, and both search and filters are working fine. But please note that MySQL Views cannot be edited properly – only one of the underlying tables can be edited if you pass the proper ID.

    Best regards.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  •   bmwork replied privately
  •  2,572
    Aleksandar replied

    Hello again guys.

    MySQL is most commonly used, yes. And I have had most experience working with it. There were some customers I came across that had very complicated queries that worked great with MySQL. On the other hand, I had others that had to create a VIEW for simpler queries. 

    Unfortunately, SQL is such a complicated and flexible language that fully automating the process for constructing queries is hardly possible. Consequently, the more complicated your request is, the higher is the probability that it will not return exactly what you need.

    Our plugin requires minimum version of PHP 5.6, but we recommend updating to 7 or more.

    Best regards.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • bmwork replied

    Hello again,

    thanks for the answer. We re-consider tech side of our solution last week. Now we've got core db on PostgreSQL and data screenshots into MySQL under wpdatatables. With MySQL as data source for tables, there are no major filtering problems.

    BR

    Marek

  •  2,572
    Aleksandar replied

    Good news, Marek, so to speaksmile.png

    Thanks for the update.

    If you run into anything else, please feel free to reach out to us.

    Best regards.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables