Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8717427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:18:14+00:00 2026-06-13T06:18:14+00:00

I am not sure how to approach this. In my application (Zend Framework, MySQL,

  • 0

I am not sure how to approach this. In my application (Zend Framework, MySQL, jQuery) one of the pages is taking over 10 seconds to load.

It’s loading under 400 records from the database, so I don’t think the bottleneck is in MySQL. Certainly a server-side select on the relevant table is not a problem:

379 rows in set (0.00 sec)

Firebug reports the delay as waiting for server response in the original request, “0 —> 11.09s Waiting”. This is the first request, and all the jQuery code gets loaded afterwards, with an onLoad time of 11.54s. So the jQuery doesn’t seem to be the bottleneck either.

No other controller/action is taking near this long to respond, so I can’t imagine it being an Apache problem. Which leaves ZF itself.

I wonder if there is a way to test where the delay occurs. Here is the full text of the relevant action:

public function listAction() 
{
    $userDepts = new Application_Model_DbTable_UserDepartments;
    $ptcpDepts = new Application_Model_DbTable_ParticipantDepts;
    $participants = new Application_Model_DbTable_Participants;
    $depts = new Application_Model_DbTable_Depts;
    $ptcpAlerts = new Application_Model_DbTable_AlertsParticipants;

    //check if sub-list is being passed
    if ($this->_helper->flashMessenger->getMessages()) {
        $passedList = $this->_helper->flashMessenger->getMessages();
        $list = $passedList['0'];
    } else {
        $list = $participants->getStaffPtcps();
    }

    $goodList = array_unique($list);
    $number = count($goodList);
    $content = array();

    foreach ($goodList as $id) {
        $deptNames = array();
        $ptcpInfo = $participants->getRecord($id);
        $ptcpDept = $ptcpDepts->getList('depts', $id);

        $flags = $ptcpAlerts->getPtcpAlerts($id);
        if (count($flags) > 0) {
            $flagTest = TRUE;
        } else {
            $flagTest = FALSE;
        }

        foreach ($ptcpDept as $did) {
            $deptName = $depts->getDept($did);
            $deptNames[$did] = $deptName['deptName'];
        }

        $content[$id] = $ptcpInfo;
        $content[$id]['depts'] = $deptNames;
        $content[$id]['flag'] = $flagTest;
    }

    foreach ($content as $c => $key) {
        $sortLastName[] = $key['lastName'];
    }

    array_multisort($sortLastName, SORT_ASC, $content);

    $this->view->list = $content;
    $this->view->count = $number;

    $this->view->layout()->customJS = 
            '<script type="text/javascript" src="/js/datePicker.js"></script>' .
            '<script type="text/javascript" src="/js/ptcpCreate.js"></script>' . 
            '<script type="text/javascript" src="/js/editDataWithModal.js"></script>' . 
            '<script type="text/javascript" src="/js/filter.js"></script>'; 

    $form = new Application_Form_AddParticipant;
    $this->view->form = $form;        
}

Any ideas about optimizing this code – or pointers where else to look – would be greatly appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T06:18:15+00:00Added an answer on June 13, 2026 at 6:18 am

    Well I dont know what your custom methods are doing but im going to assume youre making a tone od db calls:

    • $participants->getStaffPtcps(); get the inital list
    • then for each paticipant you:
      • get the full record
      • get a related list ($ptcpDepts->getList('depts', $id)) for departments
      • foreeach department you fetch even more data

    If this is correct then you are actually running a ton of queries depending on how many records the Staff Participants and Departments return. More than that each time you run this youre hydrating objects for each record unless you have specifically turned that off. This will make things super slow in a lot of cases you can probably optimize by doing this in only a couple queries with Joins, but i would have to know more about the db schema and what your methods are doing in order to tell you how.

    You could also make sure you are completely bypassing Zend_Db_Table_Row and Zend_Db_Table_Rowset.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not sure how to approach this SQL statement so please advise, even if
I'm not sure how to approach this or if it is even feasible. I
Hoping you can help as im not sure how to approach this. Cant seem
I have the following to solve and I'm not sure how to approach this:
Not totally sure how to approach this. I've researched a bit but I've come
I'm not quite sure how to approach this issue: I am creating a web
I got a design dilemma and I'm not sure how to approach this as
Not sure where to start with this one ... I'm thinking about creating a
With the absence of VisualBrush in WinRT, I am not sure the approach. Anyone?
I'm not sure how to approach queries that don't map 1:1 to my persistent

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.