Solved

what is the fastes way to search mysql?

Posted on 2008-10-22
3
185 Views
Last Modified: 2008-10-23
i want to search a database  that is made from  8,000,000 rows and eatch row have a link
like this link "http://www.google.co.uk/search?hl=en&q=ssds&btnG=Google+Search&meta="

and some rows have the same link

i want a command that can search the data base and find all the id of the rows that have the link that i want

for example
i give it
http://www.google.co.uk/search?hl=en&q=ssds&btnG=Google+Search&meta=
it give me
121223 id
3324 id
2324535 id
434343 id
343535 id
35353 id

thanks
0
Comment
Question by:mgtm3
  • 2
3 Comments
 
LVL 39

Expert Comment

by:Roger Baklund
ID: 22780670
We need a description of the database, but the SQL would be something like this:

SELECT id FROM tablename
WHERE url = 'http://www.google.co.uk/search?hl=en&q=ssds&btnG=Google+Search&meta='
0
 

Author Comment

by:mgtm3
ID: 22780743
i have the link and the id and the name of eatch man that posted the link

id -   data_link  -   d_user

when i use what you told me it take something like 80 seaconds to find the link
0
 
LVL 39

Accepted Solution

by:
Roger Baklund earned 500 total points
ID: 22780779
Probably because there is no index defined.

Show us the output of this SQL:

SHOW CREATE TABLE tablename

This will show what indexes are defined on the table.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question