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

  • Home
  • SEARCH
  • 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 6374279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:28:05+00:00 2026-05-25T01:28:05+00:00

I have a PHP + MySQL web application that runs on a typical shared

  • 0

I have a PHP + MySQL web application that runs on a typical shared hosting, and I would like to know what queries are most called and what quantity of resources are consuming. This way, I’ll focus to the most expensives queries to optimize the resources or detect badly optimized queries.

For example:

query1 - 500 times - 50% (or 44seconds or any measuring criteria)
query2 - 4000 times  - 20%
query3 - 300 times - 1%
...

How can I do this?

  • 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-05-25T01:28:06+00:00Added an answer on May 25, 2026 at 1:28 am

    For example for PDO you can create class with simple structure like follwoing:

    class DatabaseConnection extends PDO 
    {
    
        private $queries = array();
    
        public function query($stmt)
        {
           $start_time = microtime(true);
           $result = parent::query($stmt);
           $end_time = microtime(true) - $start_time;
    
           $this->queries[] = array(
            'query' => $stmt,
            'time'  => $end_time
           );
           return $result;
        }    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically I have two applications: a PHP web application that runs over Apache and
I have a simple page in a PHP/MySQL web application that lets admin users
We have a web application that has been built using MySQL / PHP /
We have a web application written in PHP that exports MySQL query results to
I have a PHP web application which uses a MySQL database for object tagging,
I have developed a PHP-MySQL web application, which is a school-based project. My client
I'm a bit obsessed now. I'm writing a PHP-MYSQL web application, using PDO, that
This is for MySQL and PHP I have a table that contains the following
I have a php page that displays rows from a mysql db as a
I'm writng a small application in PHP + MySQL and have come to the

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.