Friday, November 19, 2010

What are the database space-saving functions available in php ?

# Use ip2long() and long2ip() to store the IP adresses as Integers instead
of storing them as strings, which will reduce the space from 15 bytes to 4
bytes. This will also increase search speed and make it easy to see if a ip
falls within a specified range.

# Use gzcompress() and gzuncompress() to reduce the strings before you
store them in a database. The gzcompress can compress plain-text up to 90%.
The only reason why you shouldn’t use it is when you need full-text
indexing capabilities.

No comments:

Post a Comment

I just got my #domain @BigRock. Get upto 25% off with my personalized coupon link Get upto 25% off