Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^4: How to improve MYSQL search performance of perl?

by nan (Novice)
on Aug 24, 2005 at 17:06 UTC ( [id://486292]=note: print w/replies, xml ) Need Help??


in reply to Re^3: How to improve MYSQL search performance of perl?
in thread How to improve MYSQL search performance of perl?

Hi,

Many thanks for the code as I learned a lot from you. But even opened database once, the search is still slow (running 200 queries one by one) and I always recieve Internal Server 500 Error after a long waiting and can't see any results back to screen (before modifying, I could see a few results back as the database open and close everytime). I'm not sure it is due to the configuration of apache server or MySQL database so I'm rebuilding the database now to see if it helps.

thanks again,

Nan

  • Comment on Re^4: How to improve MYSQL search performance of perl?

Replies are listed 'Best First'.
Re^5: How to improve MYSQL search performance of perl?
by davidrw (Prior) on Aug 24, 2005 at 17:17 UTC
    Can you post your revised code? Are you re-using the statement handle? What's the error in the error_log (or if you run on command line)?

    Also, try adding $|=1; in your script to make sure it's not buffereing so yuo'll see output as it's happening.

    If the loop to execute the queries is good now (resuing handles, etc), then this probably just goes back to the issue mentioned elsewhere in this thread about SQL performance .. the speed will depend entirely on your SQL, table schema, and indexes (can you provide any of those?).

      Hi,

      After reading through Chapter 10 in MySQL Reference Manual, I'm trying to rebuild the table and index and I'll let you know what happens after that.

      Actually, the error log just says "personal.pl: Unrecognized escape \\h passed through at F:/httpserv/Top/cgi-bin/personal.pl line 11., referer: http://localhost/form.html" but the line 18 is about database connection:

      my $dbh = DBI->connect('DBI:mysql:diet', $ref) || die "Failed to connect: $DBI::errstr";

      And it's weird that the script works fine without using Apache server...

      Many thanks,

      Nan

        error says line 11, you say that line 18 is the DBI connect line... can you provide the whole (or at least top section) of the script? If you search, is there a " \h" anywhere (in a windows-style filename maybe)?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://486292]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2024-04-23 12:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found