Re: where to get mySQL questions answered?
From: Randell D. (reply.to.news.group.only_at_and.share.com)
Date: 12/31/03
- Next message: Randell D.: "Re: Page <title> from include variable?"
- Previous message: Shay Hurley: "Re: Page <title> from include variable?"
- In reply to: Zaphod Beeblebrox: "OT: where to get mySQL questions answered?"
- Next in thread: Five Cats: "Re: where to get mySQL questions answered?"
- Reply: Five Cats: "Re: where to get mySQL questions answered?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 31 Dec 2003 00:22:45 GMT
"Zaphod Beeblebrox" <foo@spamsnothere.org> wrote in message
news:C41Ib.860092$6C4.759329@pd7tw1no...
Hi:
After resolving some performance issues with mysql in building initial
queries for a search engine, I'm experiencing more crippling problems as
soon as I add an OR to my WHERE x LIKE '%blah%' type queries.
Does anyone know where I should ask this type of question? I can't find any
usenet groups on my ISP's server that match, and am in a bit of a bind here.
If anyone could be so kind as to point me in the right direction as to where
to ask, or can answer the following question, it would be greatly
appreciated.
My php code dynamically builds an sql query. If I type in a single word in
a text box, it generates something like this:
SELECT tus_site.arsi_database_id AS foo, tus_site.arsi_local_site_num,
tus_site.arsi_initial_site_num FROM tus_site INNER JOIN site_name_common ON
tus_site.arsi_database_id=site_name_common.sinaco_arsi_database_id INNER
JOIN site_name_alternate ON
tus_site.arsi_database_id=site_name_alternate.sinaalt_arsi_database_id INNER
JOIN oral_history ON
tus_site.arsi_database_id=oral_history.orhi_arsi_database_id WHERE
oral_history.orhi_desc LIKE '%things%' OR tus_site.arsi_location_desc LIKE
'%things%'
If more than one word is typed in, it adds to the WHERE clause.
With even one word being searched for (basically two criteria in the where
clause) mysqld locks up completely on Win98. If I simplify the query by
hand to have only one criterion in the WHERE clause, it works just fine and
returns expected results. I've used similar queries in a number of other
database systems, and never had a problem. Any insight? As a side note, to
get as far as I have so far, I had to manually add an index to the tus_site
table.
========================================================
First... I found when I was dynamically createing queries in MySQL, that the
length of the physical query could sometimes prove problematic - I didn't
bother playing with what the max length might be though I guessed it was
about 200characters - When codeing, I do my best to keep my query less than
this... maybe I'm wrong, maybe the problem was something else like a typo
that I corrected by shortening the query - dunno exactly, but maybe that is
something you can try out by re-entering your query on the mysql command
line exactly (thus don't do what I did and test my quey checking for
different table columns then what was in my php code.
Secondly... Remember Google keeps a good index of the newsgroups and I
believe either with them, or with deja or dejavu or something that they give
online access too - But in most cases, as long as its not porn, you should
be able to ask your ISP to add mailing.database.mysql to their news feed -
The additional traffic will not cost them but a fraction of a fraction of
their overhead... I frequent the newgroup and find it useful with little if
any junk email.
Lastly... If the problem you are facing is not the query length, then it
might be worth while posting some of your code (if its not too long) in to
this newsgroup as I am having second thoughts, thinking that since your
query works with one word, but not two - and it seems that your code might
be passing the syntax of the query wrongly (perhaps leaving your database
hanging waiting for more info - dunno - its been a long time since I've had
mysql on a win98 box)... Try echo'ing the full query to your web client
browser and then copy/paste that to your mysql client and see what the
result would be... and check error log files too!
Hope something above helps... best of luck... and happy new year,
randell d.
- Next message: Randell D.: "Re: Page <title> from include variable?"
- Previous message: Shay Hurley: "Re: Page <title> from include variable?"
- In reply to: Zaphod Beeblebrox: "OT: where to get mySQL questions answered?"
- Next in thread: Five Cats: "Re: where to get mySQL questions answered?"
- Reply: Five Cats: "Re: where to get mySQL questions answered?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|