* [EMAIL PROTECTED]
[...]
> The fun part to which I refer is (what I perceive to be) the crux of the
> problem: figuring out all (for example) adelphia.com records,
> finding their average speed, and spitting out that one line.

Isn't that what my example queries are doing?

> What I was thinking of doing is having the php run thru and
> return all domain names alphabetically, then remove the
> duplicates, then go back and do a query for each line matching
> the domain name and fetching the speeds, then averaging them
> together, then spitting it out and repeating for each domain
> name in the list.

... but... why not let the database server do it? This is exactly the kind
of work it is good at... :)

> That just
> sounds like a royal pain in the butt and I was hoping there'd be
> a slick way
> to do it all in one (albeit fat and bloated) query that didn't take five
> hours of CPU time to execute every time the page is loaded.

...ok... "every time the page is loaded"... you did not mention that this
query was supposed to return in "no time". :)

What execution times are you looking at? Have you split domain name from the
full host name? You should, to get better speed. The current solution
demands SUBSTRING_INDEX() be called for each row examined, this takes time.

--
Roger


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to