How increase VIEW speed
Hello,
I got a php application that uses a SELECT over a VIEW .
Everything is really slow to load and user has to wait a bit everytime the query run.
SELECT
Id_row_P,
AREA,
Responsabile,
Opportunita,
Gara,
Prov,
Tipo,
ValoreK,
Anno,
Mese,
Perc_Successo,
Potenz,
Fatt_potenziale_annuo,
Note_1,
Note_2,
Referente_1,
Referenze_2,
History,
Linea_P,
Strumento_Prodotto_P,
Numero_P
FROM
pipeline_view
WHERE AREA IN (***list of divisions****)
ORDER BY Id_row_P DESC
Created by this query
CREATE VIEW view_name AS
SELECT
pipeline.Id_row AS Id_row_P,
pipeline.AREA AS AREA,
pipeline.Responsabile AS Responsabile,
pipeline.Opportunita AS Opportunita,
pipeline.Gara AS Gara,
pipeline.Prov AS Prov,
pipeline.Tipo AS Tipo,
pipeline.ValoreK AS ValoreK,
pipeline.Anno AS Anno,
pipeline.Mese AS Mese,
pipeline.Perc_Successo AS Perc_Successo,
pipeline.Potenz AS Potenz,
pipeline.Fatt_potenziale_annuo AS Fatt_potenziale_annuo,
pipeline.Note_1 AS Note_1,
pipeline.Note_2 AS Note_2,
pipeline.Referente_1 AS Referente_1,
pipeline.Referenze_2 AS Referenze_2,
pipeline.History AS History,
pipeline_products.Linea AS Linea_P,
pipeline_products.product_desc AS Strumento_Prodotto_P,
pipeline_products.nr AS Numero_P
FROM
pipeline
LEFT OUTER JOIN pipeline_products ON pipeline.Id_row = pipeline_products.Id_row
GROUP BY
pipeline.Id_row
ORDER BY
`pipeline`.`Id_row` DESC