Virtual Airlines Manager

ENGLISH FORUM => Support for VAM 2.4 - 2.6 => Topic started by: Claudenir on September 19, 2018, 03:26:49 PM

Title: Flight Validation
Post by: Claudenir on September 19, 2018, 03:26:49 PM
Hello. I have a problem. The flight validation page is taking about 3 to 4 minutes to load and most of the time it still returns this error: There was an error running the query [Lost connection to MySQL server during query].
If anyone can help. thankful
Title: Re: Flight Validation
Post by: Timothee on September 19, 2018, 10:20:14 PM
Yes thats a well known problem. Create an index for the column report_id of the table va_finances.

Code: [Select]
ALTER TABLE va_finances ADD INDEX (report_id);
Title: Re: Flight Validation
Post by: Claudenir on September 20, 2018, 12:45:42 AM
My friend. Thank you very much. Solved my problem. Show
Title: Re: Flight Validation
Post by: PVI135 on April 12, 2019, 05:38:46 PM
Hi guys,
I can suggest also to change select in calculate_flight_finances.php, under SIM Acars part (line 230):

select gvauser_id, flightid, flight_duration,pax, cargo, block_fuel, distance, route_id,DATE_FORMAT(flight_date,'%Y%m%d') as flight_date
from vampireps
where validated=1
and not exists
(select 1  from va_finances where report_id = flightid);


instead of
select gvauser_id, flightid, flight_duration,pax, cargo, block_fuel, distance, route_id,DATE_FORMAT(flight_date,'%Y%m%d') as flight_date
from vampireps
where validated=1
and flightid not in (select distinct(report_id) from va_finances where report_id is not NULL);


"not in" is very very hight resource consumer

Regards,
Attilio
PVI135