Okay
  Public Ticket #2851029
Performance of chart, built by SQL query
Closed

Comments

  • Evgeniy Orlov started the conversation

    Hi

    If a chart is build by SQL query, which is not simple and contains some calculations, what are methods to speed up the chart building in the frontend?

  • [deleted] replied

    Hi Evgeniy

    Thank you for reaching out to us.

    If you are building a complicated SQL query the best solution would be to prepare a MySQL view (a stored query), which will return the data that you need, call it e.g. “view1” and then build a wpDataTabled based on a simple query like “SELECT * FROM view1″.

    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.

  •   Evgeniy Orlov replied privately
  • [deleted] replied

    You are most welcomesmile.png

    If there is anything else we can assist you with please don't hesitate to open a new ticket.

    Have a wonderful day!