indexes on float8 vs integer

From: Dennis Gearon <gearond(at)sbcglobal(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: indexes on float8 vs integer
Date: 2009-07-12 04:15:30
Message-ID: 242540.74514.qm@web82101.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Anyone got any insight or experience in the speed and size of indexes on Integer(4 byte) vs float (8byte). For a project that I'm on, I'm contemplating using an integer for:

Latitude
Longitude

In a huge, publically searchable table.

In the INSERTS, the representation would be equal to:

IntegerLatOrLong = to_integer( float8LatOrLong * to_float(1000000) );

This would keep it in a smaller (4 bytes vs 8 byte) representation with simple numeric comparison for indexing values while still provide 6 decimals of precision, i.e. 4.25 inches of resolution, what google mapes provides.

I am expecting this table to be very huge. Hey, I want to be the next 'portal' :-)
Dennis Gearon

Signature Warning
----------------
EARTH has a Right To Life

I agree with Bolivian President Evo Morales

# The right to life: "The right for no ecosystem to be eliminated by the irresponsible acts of human beings."

# The right of biosystems to regenerate themselves: "Development cannot be infinite. There's a limit on everything."

# The right to a clean life: "The right for Mother Earth to live without contamination, pollution. Fish and animals and trees have rights."

# The right to harmony and balance between everyone and everything: "We are all interdependent."

See the movie - 'Inconvenient Truth'
See the movie - 'Syriana'

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2009-07-12 07:22:28 Re: Weird disk/table space consumption problem
Previous Message Dirk Riehle 2009-07-12 01:19:39 Re: Weird disk/table space consumption problem