1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

Slow form caused by the generation of the database join field

Discussion in 'Professional Support' started by paolo.tateo, Nov 22, 2015.

  1. paolo.tateo

    paolo.tateo Member

    Level: Community
    Hi Fabrik people!

    Joomla 2.5.24
    Fabrik 3.0.5.2

    My problem is this: I have a form with in many databasejoin fields like this:
    Render join as: Drop-down
    Connection: site database
    Table: jos_app_order_status
    Value: id
    Label: order_status_name
    Joins where and/or order by statement (SQL): WHERE id_contest="{$my->id}"


    I enabled fabrikdebug (?fabrikdebug=1) and look what happens when Fabrik trying to render the field.

    Strangely Fabrik perform two queries to create the array of values:

    Code (Text):

    Array
    (
        [SELECT DISTINCT(`jos_app_order_status`.`id`) AS value, order_status_name AS text FROM `jos_app_order_status` AS `jos_app_order_status`  ORDER BY text ASC ] => Array
     

    And after

    Code (Text):

        [SELECT DISTINCT(`jos_app_order_status`.`id`) AS value, order_status_name AS text FROM `jos_app_order_status` AS `jos_app_order_status` WHERE id_contest="1835" ORDER BY text ASC ] => Array
     
    The first query takes out thousands of results, then the second only three results. Since I have dozens of similar fields, the time taken to open the form is over 60 seconds.

    Today I can't still update Fabrik, then I would prefer to change only the code necessary. I planned a major update in a couple of months, but I have to go slow: This site consists of 180 lists with a database of 120 GB. We are entering the Guinness Book of Fabrik?

    Thanks
     
  2. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    I'd have to see the site and enable Fabrik debug mode to see what's happening. It looks like the join's buildQuery() is being called a second time but without "incFilters" set, which doesn't happen in 3.1, and I can't immediately see why it would happen in 3.0.

    Note that we really don't support 3.0 development any more, so if this needs some custom coding, we would have to charge on an hourly basis for that.

    -- hugh
     
  3. paolo.tateo

    paolo.tateo Member

    Level: Community
    Hi Hugh!

    I try to accelerate migration to Fabrik 3.3.x

    Thanks
     
  4. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    And yes, you are definitely in the Guinness Book of Fabrik!

    -- hugh
     
    paolo.tateo likes this.

Share This Page