Posted: Sat Jun 04, 2005 5:10 pm
Attention: code is untested... As always: make sure you have a backup :p
Not very certain, but meaby that saving the ip as an integer might increase speed even more...
Code: Select all
CREATE INDEX ip_idx ON visitors (ip)
CREATE INDEX timestamp_idx ON visitors (timestamp)Not very certain, but meaby that saving the ip as an integer might increase speed even more...
Code: Select all
ALTER visitors
ADD ipnew INTEGER
UPDATE visitors
SET ipnew= substring(ip, 1, 3) * 256^3 + substring(ip, 5, 3) * 256^2 + substring (ip, 9, 3) * 256 + substring(ip, 13, 3)
ALTER vistors
DELETE ip
ALTER visitors
RENAME ipnew ip