Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: s/Perl/SQL/ ?

by Corion (Pope)
on Sep 10, 2012 at 13:47 UTC ( #992762=note: print w/ replies, xml ) Need Help??


in reply to s/Perl/SQL/ ?

Where is Perl embedded in your query? What part of constructing the string is slow?

Maybe you want to talk to your database administrator about the data model and how to best access it? Most databases, and especially MySQL, are bad at doing LIKE (and, without benchmarking, even worse at doing NOT LIKE) queries, because usually there are no indices that handle substring queries and/or postfixes well.

My rough recommendation, without knowing your data model, is to read Use the Index Luke, and then to set up some benchmarks/EXPLAIN queries to find out how your data model can be improved by indices. Most likely, adding a trigger and separate column for the "8" will improve things.


Comment on Re: s/Perl/SQL/ ?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2014-09-21 19:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (175 votes), past polls