[MySQL] Fastest way to Search from a Table

2007-08-07 Thread Tharabar
Can someone suggest me.. ? To make a keyword search from a specific field from a Table that have millions of rows. I used normal SQL query as follow SELECT `field1`,`field2`,`field3` FROM 'table' WHERE `field5` LIKE '%keyword%1' AND `field5` LIKE '%keyword2%' (Field 5 is text and not an index

Re: [MySQL] Fastest way to Search from a Table

2007-08-07 Thread Alex Arul Lurthu
On 8/7/07, Tharabar [EMAIL PROTECTED] wrote: SELECT `field1`,`field2`,`field3` FROM 'table' WHERE `field5` LIKE '%keyword%1' AND `field5` LIKE '%keyword2%' The most trivial way to speedup a query is to add an index on the columns that are being used in the where clause. But doing 'LIKE'

purge slow query log

2007-08-07 Thread Boyd Hemphill
I would like to empty the slow query log without restarting MySQL. If I simply delete lines, the server will no longer write to the file. I have tried leaving the header, but still no writes unless I restart MySQL. I am on RHEL4. The group and owner of the file are correct: 4 -rw-rw

auto increment format

2007-08-07 Thread shivendra
Hi, I'm looking for some basic help. I am developing a MySQL database and want to auto increment a field, but I don't want it to just count 1,2,3, etc. I want the field to be a combination of letters and numbers, at least 8 digits long, completely random for security porposes, but do this

Fwd: auto increment format

2007-08-07 Thread Olexandr Melnyk
You can do that using a before insert trigger, something like (untested) : CREATE TRIGGER test1bi BEFORE INSERT ON test1 FOR EACH ROW BEGIN NEW.ID = COALESCE( NEW.ID, SHA1(CAST(RAND() AS CHAR))) END; 2007/8/7, shivendra [EMAIL PROTECTED]: Hi, I'm looking for some basic help. I am

RE: 2007 MySQL Community Survey - Got Ten Minutes to Spare?

2007-08-07 Thread dpgirago
Having a moment of altruism, I started doing the survey only to find that it wouldn't let me advance to the next page (from either page 1 or page 2, can't recall). I kept getting an error of an answer is required of this question even when I had provided one. No good deed goes unpunished

Re: 2007 MySQL Community Survey - Got Ten Minutes to Spare?

2007-08-07 Thread David T. Ashley
You are more altruistic than I can ever be. Every time I go through a nameless fast-food drive-through (too often, based on my girth), they offer me a chance to win $1,000 if I complete a survey. I never take those surveys. Reasons: a)If, for example, 10,000 people take the survey and the

RE: 2007 MySQL Community Survey - Got Ten Minutes to Spare?

2007-08-07 Thread J.R. Bullington
I received the same as David. The question was: What OS do you currently use? Please check all that apply: (page 3, question 4 or 5): I chose Linux 2.6.x and Windows. It kept telling me that I needed to answer the question. I changed the answer to just Linux and it let me

Re: Fwd: auto increment format

2007-08-07 Thread Lucas . CTR . Heuman
Isn't there a chance that you could get a ID that is the same as one already in use? and if this happens what happens on the insert? Wishing you the best you know you deserve, __ Lucas Heuman Web Developer Ricomm Systems Inc. FAA, WJHTC/Bldg 300, 3nd Fl., L33 Atlantic City

Re: Fwd: auto increment format

2007-08-07 Thread David T. Ashley
You might not need to do this in the way you are suggesting (depending on your application). I'm not sure why you feel you need to combine the autoincrement with the hash into the same field. Does it really do harm if two records have the same hash? It might work as well to have two separate

auto increment format

2007-08-07 Thread Boyd Hemphill
Shivendra: It looks to me based on your example that you are creating a smart field where the first three chars are some sort of category and the numeric part is random. If you example is accurate then a char(3) field and a standard auto_increment field will do the trick. If uniqueness is

Re: auto increment format

2007-08-07 Thread David T. Ashley
On 8/7/07, Boyd Hemphill [EMAIL PROTECTED] wrote: Suggestions to use a hash are a problem because once you have a few million rows the likelihood of a collision is quite high if you cannot afford an error stopping your application. This means that if you write a trigger (the obvious way to

Re: 2007 MySQL Community Survey - Got Ten Minutes to Spare?

2007-08-07 Thread Jay Pipes
Thanks for the input! Hopefully, I've fixed the problem. Please retry. It should have saved your previous answers. Thanks much! Jay J.R. Bullington wrote: I received the same as David. The question was: What OS do you currently use? Please check all that apply: (page 3,

Re: purge slow query log

2007-08-07 Thread Sean Pringle
On 8/7/07, Boyd Hemphill [EMAIL PROTECTED] wrote: I would like to empty the slow query log without restarting MySQL. If I simply delete lines, the server will no longer write to the file. I have tried leaving the header, but still no writes unless I restart MySQL. I am on RHEL4. The group