Author Topic: Flight Validation  (Read 181 times)

Claudenir

  • Newbie
  • *
  • Posts: 21
    • View Profile
Flight Validation
« 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

Timothee

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
Re: Flight Validation
« Reply #1 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);

Claudenir

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Flight Validation
« Reply #2 on: September 20, 2018, 12:45:42 AM »
My friend. Thank you very much. Solved my problem. Show

PVI135

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Flight Validation
« Reply #3 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