Author Topic: [VAM2.6.2] Acars Data MAX_JOIN_SIZE  (Read 627 times)

Timothee

  • Jr. Member
  • **
  • Posts: 74
    • View Profile
[VAM2.6.2] Acars Data MAX_JOIN_SIZE
« on: May 07, 2017, 03:14:32 PM »
Hi

After a while it may happen that the flight details page only shows an error message instead of the acars data:
Code: [Select]
The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
In my oppinion there is an unnecessary join in the SQL statement.
I changed the last SQL query in flight_details.php and validate_vam_acars.php as followed:
Code: [Select]
$sql = "select vt.time_flag, vt.flight_status,vt.ias,vt.gs,vt.altitude,vt.fuel_used,vt.oat from vam_track vt where vt.flight_id='" . $vamflightid . "' order by vt.id asc";

VAM

  • Administrator
  • Hero Member
  • *****
  • Posts: 1327
    • View Profile
    • virtual Airlines Manager
Re: [VAM2.6.2] Acars Data MAX_JOIN_SIZE
« Reply #1 on: May 25, 2017, 09:33:38 PM »
Hi

After a while it may happen that the flight details page only shows an error message instead of the acars data:
Code: [Select]
The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
In my oppinion there is an unnecessary join in the SQL statement.
I changed the last SQL query in flight_details.php and validate_vam_acars.php as followed:
Code: [Select]
$sql = "select vt.time_flag, vt.flight_status,vt.ias,vt.gs,vt.altitude,vt.fuel_used,vt.oat from vam_track vt where vt.flight_id='" . $vamflightid . "' order by vt.id asc";

Thanks again, I am now integrating all your fixes + other from me
VAM Creator and programmer.

FSC190

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: [VAM2.6.2] Acars Data MAX_JOIN_SIZE
« Reply #2 on: August 06, 2018, 10:32:56 AM »
Hi,
is there a fix or update available now?

Timothee

  • Jr. Member
  • **
  • Posts: 74
    • View Profile
Re: [VAM2.6.2] Acars Data MAX_JOIN_SIZE
« Reply #3 on: January 10, 2019, 11:25:33 AM »
Over time another query leads to the same problem.

In flight_details.php the first SQL statement (about line 34) again contains more joins than necessary.

Original statement:
Code: [Select]
$sql = "select * , date_format(flight_date,'$va_date_format') as flight_date from vam_track vt , vampireps vp ,gvausers u where vt.flight_id = vp.flightid and u.gvauser_id = vp.gvauser_id and vp.flightid='" . $vamflightid . "'";

Modified statement:
Code: [Select]
$sql = "select * , date_format(flight_date,'$va_date_format') as flight_date from vampireps vp, gvausers u where u.gvauser_id = vp.gvauser_id and vp.flightid='" . $vamflightid . "'";
« Last Edit: January 10, 2019, 12:31:21 PM by Timothee »