Forum Moderators: coopster

Message Too Old, No Replies

how can i speed up this query?

the query takes too much time. big tables.

         

ikbenhet1

9:17 pm on Feb 4, 2004 (gmt 0)

10+ Year Member



I'm having trouble with this query:

select x.id, y.* from site_id x, site_ranking y where y.url=x.url

The query takes more than a day, so i stop it. How can i speed up the process?
The tables have many records in them, say 400,000 in site_ranking and 120,000 in site_id.

I thought maybe it's better to download these tables as a textfile and use a program from my computer at home, but i know no such program.

Do you know a better query, or maybe a program i can use? thanks.

mykel79

9:29 pm on Feb 4, 2004 (gmt 0)

10+ Year Member



More than a day sounds awfully long.
Have you tried adding an index for the url field in both tables? It can speed things up immensly. Also,
optimize tablename
might help if you've done lots of deletes and insert on the table.

ikbenhet1

9:55 pm on Feb 4, 2004 (gmt 0)

10+ Year Member




thank you, it indeed speeds things up much, i was using fulltext for both urls... thanks again!

mykel79

10:18 pm on Feb 4, 2004 (gmt 0)

10+ Year Member



You're welcome :)