![](https://secure.gravatar.com/avatar/5d0df01f0d551434c05f840f9f84a640.jpg?s=120&d=mm&r=g)
Hi Vincentiu. Thanks for your comments, I can't now do the query because exists clients using the web app, so I do the query directly on phpmyadmin and this say: /ANALYZE SELECT * FROM FACTURACION WHERE ID_USUARIO='ndbny' AND (TIMBRE_FISCAL!='' OR TIMBRE_FISCAL!='0') AND PAGADA!='1' AND CANCELADO='0' AND FECHA BETWEEN '1514764800' AND '1576073257' ORDER BY FECHA DESC LIMIT 1,15;/ PHPMyAdmin is in the same server where the mariaDB is running, but the web app is in a different server (digital ocean) Regards ! On 12/11/19 1:12 AM, Vicențiu Ciorbaru wrote:
Hi Angel!
May I suggest you also post the EXPLAIN output for the query that is causing problems?
EXPLAIN select * from FACTURACION where ID_USER='ID_HASH' order by SERVER_DATE limit 1,12;
It seems like this table is the biggest one you have. If you are running MariaDB 10.1 or greater, you can replace ANALYZE with EXPLAIN. This will also run the query and show how many rows were scanned compared to the expected number of scanned rows, in addition to providing the query plan.
Come back with that information and I might be able to take you in the right direction towards fixing this.
Vicențiu
On Wed, 11 Dec 2019 at 05:32, Ing Angel Cantu
mailto:angel.cantu@sie-group.net> wrote: Hi.
I have problems to make query to a table from the db, is delaying so much (too slow), I don't know whats I need to do, I do some test to my code but is not the problem, is the table.
When I make a select to the table marked with red, the response delay 6 or 8 seconds, but, if I do a query to another table the response delay 1 second (fast). Only the table marked with red is delaying.
I do this specific query:
/select * from FACTURACION where ID_USER='ID_HASH' order by SERVER_DATE limit 1,12;// /
I only query the first 12 results order by date, and in the code I make the pagination using "?page=NUMBER"
Regards!
--
AngelHanielCantuJauregui
angel.cantu@moneybox.business mailto:angel.cantu@moneybox.business;
Gerencia | Servicios de Innovacion para Empresas SA de CV
Proveemos soluciones para facilitar la administración de tu negocio y garantizar tus próximas vacaciones en compañia de tu familia sin preocupaciones
(818) 421 9924 tel:(818)%20421%209924 | (899) 871 1722 https://wa.me/528998711722
angel.cantu@moneybox.business mailto:angel.cantu@moneybox.business
20 de noviembre #300, CP 88780 Reynosa, Tamps, Mexico
facebook https://business.facebook.com/moneyboxco/ twitter https://twitter.com/moneyboxlatam/ linkedin https://www.linkedin.com/company/27011448/ instagram https://www.instagram.com/moneyboxlatam/
_______________________________________________ Mailing list: https://launchpad.net/~maria-discuss Post to : maria-discuss@lists.launchpad.net mailto:maria-discuss@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-discuss More help : https://help.launchpad.net/ListHelp
--
AngelHanielCantuJauregui
angel.cantu@moneybox.business mailto:angel.cantu@moneybox.business;
Gerencia | Servicios de Innovacion para Empresas SA de CV
Proveemos soluciones para facilitar la administración de tu negocio y
garantizar tus próximas vacaciones en compañia de tu familia sin
preocupaciones
(818) 421 9924