PHP and mysql seems very slow.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • joe soap

    PHP and mysql seems very slow.

    HI all,

    I am testing php and mysql, because our ISP only uses that.

    To retrieve 25 records from a table of 1564 records, and display the
    result
    in the browser in a table takes 4 secs with php and mysql. This is running
    directly on my PC. With dbase cgi and native dbf tables, the exact same
    query is
    displayed instantly, the time difference shows as 0.00s.
    Cna this be. in my php script I am using ... while ($row =
    mysql_fetch_row ($qs)) ... to get and then display the rows
    Can I speed this up

    If it takes this long on a small database, imagine when we go productive,
    eeeek

    Thanks

    Robert




  • Garp

    #2
    Re: PHP and mysql seems very slow.


    "joe soap" <me@u.com> wrote in message
    news:-pCdneWcLY1NZC3d 4p2dnA@is.co.za ...[color=blue]
    > HI all,
    >
    > I am testing php and mysql, because our ISP only uses that.
    >
    > To retrieve 25 records from a table of 1564 records, and display the
    > result
    > in the browser in a table takes 4 secs with php and mysql. This is running
    > directly on my PC. With dbase cgi and native dbf tables, the exact same
    > query is
    > displayed instantly, the time difference shows as 0.00s.
    > Cna this be. in my php script I am using ... while ($row =
    > mysql_fetch_row ($qs)) ... to get and then display the rows
    > Can I speed this up
    >
    > If it takes this long on a small database, imagine when we go productive,
    > eeeek
    >
    > Thanks
    >
    > Robert[/color]

    So many factors, so little time. I take it you've been through EXPLAIN's
    output and spotted any indexing problems?


    Garp


    Comment

    • Jochen Daum

      #3
      Re: PHP and mysql seems very slow.

      Hi joe,

      On Sun, 23 May 2004 21:26:54 +0200, "joe soap" <me@u.com> wrote:
      [color=blue]
      >HI all,
      >
      >I am testing php and mysql, because our ISP only uses that.
      >
      >To retrieve 25 records from a table of 1564 records, and display the
      >result
      >in the browser in a table takes 4 secs with php and mysql. This is running
      >directly on my PC. With dbase cgi and native dbf tables, the exact same
      >query is
      >displayed instantly, the time difference shows as 0.00s.
      >Cna this be. in my php script I am using ... while ($row =
      >mysql_fetch_ro w($qs)) ... to get and then display the rows
      >Can I speed this up
      >
      >If it takes this long on a small database, imagine when we go productive,
      >eeeek[/color]

      With this speed I would assume a DNS problem. On which boxes are MySql
      and PHP and how is MySQL accessed (Server Name?).

      HTH, Jochen
      --
      Jochen Daum - Cabletalk Group Ltd.
      PHP DB Edit Toolkit -- PHP scripts for building
      database editing interfaces.
      Download PHP DB Edit Toolkit for free. PHP DB Edit Toolkit is a set of PHP classes makes the generation of database edit interfaces easier and faster. The main class builds tabular and form views based on a data dictionary and takes over handling of insert/update/delete and user input.

      Comment

      • Chung Leong

        #4
        Re: PHP and mysql seems very slow.

        "joe soap" <me@u.com> wrote in message
        news:-pCdneWcLY1NZC3d 4p2dnA@is.co.za ...[color=blue]
        > I am testing php and mysql, because our ISP only uses that.
        >
        > To retrieve 25 records from a table of 1564 records, and display the
        > result
        > in the browser in a table takes 4 secs with php and mysql. This is running
        > directly on my PC. With dbase cgi and native dbf tables, the exact same
        > query is
        > displayed instantly, the time difference shows as 0.00s.
        > Cna this be. in my php script I am using ... while ($row =
        > mysql_fetch_row ($qs)) ... to get and then display the rows
        > Can I speed this up[/color]

        Are there indices on the columns that you're searching? I have noticed that
        MySQL requires more manual optimization than the database that I usually use
        (MS SQLServer).


        Comment

        • joe soap

          #5
          Re: PHP and mysql seems very slow.

          Hi,
          [color=blue]
          > So many factors, so little time. I take it you've been through EXPLAIN's
          > output and spotted any indexing problems?
          > http://dev.mysql.com/doc/mysql/en/EXPLAIN.html
          >
          > Garp
          >[/color]
          Thanks for the response. The column is indexed, no noticable difference. I
          take it that it must be me, something that I am doing wrong, because when I
          test the database inmyphp admin, trying a browse, it is significantly
          faster.
          Any ideas.

          Thanks
          Robert


          Comment

          • joe soap

            #6
            Re: PHP and mysql seems very slow.

            HI,
            [color=blue]
            >
            > With this speed I would assume a DNS problem. On which boxes are MySql
            > and PHP and how is MySQL accessed (Server Name?).
            >[/color]

            Thanks for the response.
            I did not set up a DNS, I assumed that PHP did not need a DNS as it was
            accessing the database directly. Anyway I can still access the data without
            a dns setup. I take it that it must be me, something that I am doing wrong,
            because when I test the database inmyphp admin, trying a browse, it is
            significantly faster.
            Any ideas.


            Thanks
            Robert



            Comment

            • joe soap

              #7
              Re: PHP and mysql seems very slow.

              HI,
              [color=blue]
              > Are there indices on the columns that you're searching? I have noticed[/color]
              that[color=blue]
              > MySQL requires more manual optimization than the database that I usually[/color]
              use[color=blue]
              > (MS SQLServer).[/color]

              Thanks for the response. Yes the column is indexed by the same column that I
              orderby. I take it that it must be me, something that I am doing wrong,
              because when I test the database inmyphp admin, trying a browse, it is
              significantly faster.
              Any ideas.


              Thanks
              Robert



              Comment

              Working...