If you wanna test this query with PostgreSQL, give me some info on your distribution and number of entries etc and I'd be happy to build a test data set (or download one from you if that's ok) and test it on a postgresql db.
Thats a very kind offer - thanks. I'm not sure that I can give you a copy of the data as the tracking data is commercially sensitive and the ip/geographical localisation table is under licence, however there is a table of 196,000 ip addresses, each with their INT(10) equivalent that I was looking up against a table containing 88,000 ip/location rows, though I was limiting the recordset to 800 for the report that caused all the problems.
MySQL vs PostgeSQL is a very valid decision for us at this stage, though, as these problems have been encountered during the development of a prototype system that we want to release as a commercial product.
We intend to release the product as a hosted, rather than distributed application, and hence have to consider server sizing, choice of database and the overall feasibility of the project from a database size and handling point of view.
There could potentially be 10,000 web sites to log, with each web site generating 10,000 log entries, though this is an end goal that would take time to achieve.
So decisions about running a single table with potentially 100 Million entries or splitting the data into many databases have to me made, and server sizing and infrastructure design have to be taken into account.
I've no experience with postgreSQL, so I'd be interested in your views about which would be more suitable for database applications of this size. We don't want to use Oracle as it would be too expensive.
The entry logging is actually easy and not load intensive - a simple lookup against the location table (now we are doing it that way, after these issues) and then an insert query, however the reporting could be more challenging as we will need joined queries against large data sets.
Thanks
Chris