How can I make queries faster on a MySQL
table with 3 million records, the table has only 4 columns, and it takes me almost 5 seconds to return data. The fields I'm searching for have index
. The Query
returns close to 50,000 records and is executed by MySQL WorkBench
. I leave some more information below and if necessary I can provide more information.
Query:
SELECT campo2, campo3, campo4 FROM tabela2
WHERE campo2=25 AND campo3>='2016-09-01 00:00' AND campo3<='2016-10-01 00:00'
Table2 Structure:
id - bigint
campo2 - int - index
campo3 - timestamp - index
campo4 - float
Can anyone help me with anything?