totaling count column where separate column's record values are alike

2007-06-08 Thread Ally Messi
Can someone please help me with the following: code so far SELECT DISTINCT ip, COUNT(DISTINCT round_to_nearest_five_minutes(date)) as url_hit_count, request from logs_empty GROUP BY substring_index(request, '/', 3) ; I would like to add on to the the code an additional column that adds up the

SOLVED Re: totaling count column where separate column's record values are alike

2007-06-08 Thread Ally Messi
I changed it around a bit to count distict requests and dates and group by ip. This did the trick! On 6/8/07, Ally Messi [EMAIL PROTECTED] wrote: Can someone please help me with the following: code so far SELECT DISTINCT ip, COUNT(DISTINCT round_to_nearest_five_minutes(date)) as

Re: Why would a SELECT COUNT(*)... WHERE... take way way longer than SELECT COUNT(primary_key)... WHERE... ?

2006-06-19 Thread cvizitiu
Alex Arul wrote: count(*) is slow in innodb due to Multi Versioning. Which table type are you using ? Hi Alex, Thanks for answering; All tables are MyISAMs. I'm beginning to wonder if I am not taxed heavily for using floats for the geographic coordinates. -- MySQL General Mailing List

Re: Why would a SELECT COUNT(*)... WHERE... take way way longer than SELECT COUNT(primary_key)... WHERE... ?

2006-06-17 Thread Alex Arul
on a 1.8GB 42mil records table: SELECT COUNT(*) FROM geoRecord WHERE geoRecord.geolatitude IS NOT NULL ; As it took forever to complete (I mean more than 20 minutes) I've stopped the client and attempted to work around. The table looks like this: EXPLAIN geoRecord

Re: Why would a SELECT COUNT(*)... WHERE... take way way longer than SELECT COUNT(primary_key)... WHERE... ?

2006-06-17 Thread Jad madi
: SELECT COUNT(*) FROM geoRecord WHERE geoRecord.geolatitude IS NOT NULL ; As it took forever to complete (I mean more than 20 minutes) I've stopped the client and attempted to work around. The table looks like this: EXPLAIN geoRecord

Why would a SELECT COUNT(*)... WHERE... take way way longer than SELECT COUNT(primary_key)... WHERE... ?

2006-06-09 Thread cvizitiu
Hi everybody, MySQL 5.0.21 running on RedHat EL4, 2GHz CPU, 2,5GB RAM, RAID5/128MB RAM. At one point I had to issue the following query on a 1.8GB 42mil records table: SELECT COUNT(*) FROM geoRecord WHERE geoRecord.geolatitude IS NOT NULL ; As it took forever to complete (I mean more than

COUNT and WHERE

2001-05-31 Thread Ben Smith
Hello, I have this query select a.match_id, count(a.players_id) as num, a.description from a group by a.players_id, a.match_id order by num desc I only want to see the records where the count of players_id is greater than 1, and in various other DB's i'd use the Having clause, so i tried where