Sunday, March 10, 2019
mySql Optimize date queries and inserts
High Level of use
DROP INDEX VENTAS_fecven_idx ON VENTAS
select * from VENTAS where date(fecven)='2019-03-09' #~2.81
select * from VENTAS where fecven >='2019-03-09 00:00:00' and fecven<'2019-03-10 00:00:00' #~2.9
select * from VENTAS where fecven Between '2019-03-09 00:00:00' and '2019-03-10 00:00:00' #~3.6
CREATE INDEX VENTAS_fecven_idx ON VENTAS (fecven)
select * from VENTAS where date(fecven)='2019-03-09' #~2.794
select * from VENTAS where fecven >='2019-03-09 00:00:00' and fecven<'2019-03-10 00:00:00' #~0.265
select * from VENTAS where fecven Between '2019-03-09 00:00:00' and '2019-03-10 00:00:00' #~0.261
CREATE INDEX MOVPRO_fecmov_idx ON MOVPRO (fecmov)
#change date(fecmov) between f1 and f2
#to fecmov between f1 and f2 #implicit add 00:00:00
DROP INDEX MOVPRO_fecmov_idx ON MOVPRO
Setting mysql
SET GLOBAL bulk_insert_buffer_size = 1024 * 1024 * 128;
[mysqld]
bulk_insert_buffer_size=128M
References
[1] Insert https://dev.mysql.com/doc/refman/8.0/en/insert-optimization.html
[2] Amazon Best Practices https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_BestPractices.html
Subscribe to:
Post Comments (Atom)
-
Resources: [1] Hela https://ome.grc.nia.nih.gov/iicbu2008/hela/index.html
-
Sunedu Renacyt 1) https://ctivitae.concytec.gob.pe/appDirectorioCTI/ 2) http://regina.concytec.gob.pe 3) https://www.gob.pe/9648-ser-p...
-
en inglés se llama “A potentially dangerous Request.Form value was detected from the client”. varias páginas indican dos cosas: 1. agrega...
Running apps
Runtastic (I uninstalled because force to update your device - Internet connection problems) Runkeeper (Wrong GPS tracking) Strava (Curr...
No comments:
Post a Comment