mysql hangs with three consecutive Where

mysql hangs with three consecutive Where

RafaelGarciaRafaelGarcia Posts: 20Questions: 1Answers: 0

when utilizi leftjoin, mysql hangs with three consecutive Where; what am I doing wrong ?

$out = $editor

->where( 'tms_slots_salas.sala_id',$_SESSION['sala_id'] ) 
->where( 'tms_novedades.novedad_estado','abierta' )
->where( 'tms_requerimientos.requerimiento_estado','recibido/error','<>')
->process($_POST) 
->data();

Replies

  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin

    Does it ever complete? Do you get any errors? What is the JSON response from the server? Is there any information in the server's error log?

    Allan

  • RafaelGarciaRafaelGarcia Posts: 20Questions: 1Answers: 0

    when one of the filtered data is not there when hung. The complete stop and the answer took seven minutes (7m 23s).
    for example :

    ->where( 'tms_requerimientos.requerimiento_estado','recibido/error','<>')

    the absence of any 'recibido/error' the colsulta delay 7 minutes (7m 23s) and the database crashes.

  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin

    Can you print out the SQL statement that is being used by Editor and try to run that directly. it sounds like the tables might need to be optimised.

    You can find the SQL statement being used by editing the Database/Drivers/Mysql/Query.php file and uncommenting the line starting file_put_contents(). Update the path as needed for your system of course - then reload the page and check the created file.

    Allan

  • RafaelGarciaRafaelGarcia Posts: 20Questions: 1Answers: 0
    edited February 2016

    change

    ->where( 'tms_slots_salas.sala_id',$_SESSION['sala_id'] )
    ->where( 'tms_novedades.novedad_estado','abierta' )
    ->where( 'tms_requerimientos.requerimiento_estado','recibido/error','<>')
    ->process($_POST)
    ->data();
    

    by

    ->where( 'tms_salas.sala_id',$_SESSION['sala_id'] )
    ->where( 'tms_novedades.novedad_estado','abierta' )
    ->where( 'tms_requerimientos.requerimiento_estado','recibido/error','<>')
    ->process($_POST)
    ->data();
    

    and he began to run very fast. I think the problem was in the link table ("tms_slots_salas").
    thanks.

    Rafael

    Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin

    Awesome - good to hear you've got it going now.

This discussion has been closed.