Results 1 to 4 of 4

Thread: Number of queries to MySQL

  1. #1

    Default Number of queries to MySQL

    Hello Yab,

    Want to optimize AIHS, but before, looking to see a number of queries made by a script, for example for show.php script

    Can you help to do that?

  2. #2
    Join Date
    May 2005
    Location
    China & France
    Posts
    6,492

    Default

    Here is a method: edit footer.php, at the end of this file, insert the following lines,

    PHP Code:
     echo '<!--'.$db->allSql.'-->';
        echo 
    '<!--';print_r(get_included_files());echo '-->';
        echo 
    '<!--The page is generated in '.$totaltime.' seconds. MYSQL Queries are executed in '.round($db->totaltime,5).' seconds('.(100*round($db->totaltime/$totaltime,3)).'%)-->'
    Then you can check the mysql details at the end by viewing source code of the page you accessed.

  3. #3

    Default

    Have checked results:
    Code:
    			<!-- 0.01046 --><!--select * from setting
    select * from server
    select * from groups
    select i.id,i.file,i.views,i.name,i.size,i.width,i.height,i.server_id,i.safe,i.private,i.tags
                   from images as i
                   where i.id='3079439'
    UPDATE `images` SET `views` = `views`+1 WHERE `id` = '3079439';
    --><!--Array
    (
        [0] => /home/www/dymytrov/data/www/xmages.net/show.php
        [1] => /home/www/dymytrov/data/www/xmages.net/includes/inc.php
        [2] => /home/www/dymytrov/data/www/xmages.net/config.php
        [3] => /home/www/dymytrov/data/www/xmages.net/includes/database.php
        [4] => /home/www/dymytrov/data/www/xmages.net/includes/function.php
        [5] => /home/www/dymytrov/data/www/xmages.net/includes/core.func.php
        [6] => /home/www/dymytrov/data/www/xmages.net/includes/class.smarttemplate.php
        [7] => /home/www/dymytrov/data/www/xmages.net/includes/class.smarttemplateparser.php
        [8] => /home/www/dymytrov/data/www/xmages.net/includes/class.phpmailer.php
        [9] => /home/www/dymytrov/data/www/xmages.net/includes/email.class.php
        [10] => /home/www/dymytrov/data/www/xmages.net/includes/user.class.php
        [11] => /home/www/dymytrov/data/www/xmages.net/language/english.php
        [12] => /home/www/dymytrov/data/www/xmages.net/includes/gal.func.php
        [13] => /home/www/dymytrov/data/www/xmages.net/header-show.php
        [14] => /home/www/dymytrov/data/www/xmages.net/gzip.php
        [15] => /home/www/dymytrov/data/www/xmages.net/skin/default/cache/header-show_html.php
        [16] => /home/www/dymytrov/data/www/xmages.net/skin/default/cache/show_html.php
        [17] => /home/www/dymytrov/data/www/xmages.net/skin/default/cache/tag_lists_inc_html.php
        [18] => /home/www/dymytrov/data/www/xmages.net/footer-show.php
        [19] => /home/www/dymytrov/data/www/xmages.net/skin/default/cache/footer-show_html.php
    )
    --><!--The page is generated in  seconds. MYSQL Queries are executed in 0 seconds(0%)-->
    It means 19 queries?

  4. #4
    Join Date
    May 2005
    Location
    China & France
    Posts
    6,492

    Default

    No ... these are the sql queries used on this page:

    select * from setting
    select * from server
    select * from groups
    select i.id,i.file,i.views,i.name,i.size,i.width,i.height ,i.server_id,i.safe,i.private,i.tags
    from images as i
    where i.id='3079439'
    UPDATE `images` SET `views` = `views`+1 WHERE `id` = '3079439';

    The file lists are the scripts included in the page.

Similar Threads

  1. Upload bar and info are not working
    By N1ssan in forum Free Trial Support
    Replies: 5
    Last Post: 03-15-2010, 10:43 PM
  2. MFHS up to 30% speed increase (Mysql Nurse)
    By picshome in forum Mods/Skin/Hosting Request&Offers
    Replies: 19
    Last Post: 08-29-2008, 07:16 PM
  3. Installing Error pls Help
    By b3t1m0s in forum Free Trial Support
    Replies: 5
    Last Post: 07-26-2007, 03:54 PM
  4. Help with installation - I get errors
    By Artanis in forum Troubleshooting And Problems
    Replies: 2
    Last Post: 06-13-2007, 04:29 PM
  5. Database Error Corrections
    By yabsoft in forum Document & Tutorials!
    Replies: 0
    Last Post: 10-11-2006, 12:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •