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 <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!

--

Angel Haniel Cantu Jauregui

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 | (899) 871 1722
angel.cantu@moneybox.business
https://www.moneybox.business
20 de noviembre #300, CP 88780
Reynosa, Tamps, Mexico



facebook
twitter
linkedin
instagram


_______________________________________________
Mailing list: https://launchpad.net/~maria-discuss
Post to     : maria-discuss@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-discuss
More help   : https://help.launchpad.net/ListHelp