Use ip2long() and long2ip() to store the IP addresses 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.
what are the database space-saving functions available in php ?
Posted by
php helper
at
8:27 AM
Labels: code optimization, php
Subscribe to:
Post Comments (Atom)

0 comments:
Post a Comment
Post your helpful suggestions on this...