Hola,
Tengo una consulta, no muy grande y hasta donde entiendo no debería ser tan ineficaz. Actualmente tarda ~110s, la tabla no contiene muchos registros (200k), lo que supongo que el problema está en el subquery, ¿alguna sugerencia?
Código MySQL:
Ver original auctions_flight.id,
auctions_flight.`date`,
origins.code
as origin_code
, destinations.name
as destination
, destinations.code
as destination_code
, auctions_flight.num_seating,
auctions_flightprice.Price,
auctions_flightprice.currency
auctions_flight
auctions_flightprice
ON auctions_flight.price_id
= auctions_flightprice.id
locations_location
as destinations
ON auctions_flight.destination_location_id
= destinations.id
locations_location
as origins
ON auctions_flight.origin_location_id
= origins.id
auctions_flight.num_seating >= 3
AND auctions_flightprice.currency
= 'MXN' auctions_flightprice
origin_location_id = auctions_flight.origin_location_id
AND destination_location_id
= auctions_flight.destination_location_id
AND `date` = auctions_flight.
`date`)
Saludos.