Re: [HACKERS] indexes and floats

From: Vince Vielhaber <vev(at)michvhf(dot)com>
To: "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
Cc: hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] indexes and floats
Date: 1998-08-03 12:40:29
Message-ID: XFMail.980803084029.vev@michvhf.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 03-Aug-98 Thomas G. Lockhart wrote:
>> Is this a bug that the index doesn't work on floats or is it a
>> datatype mismatch thing?
>> Seq Scan on foo (cost=0.00 size=0 width=8)
>
> Likely neither. Notice the cost of a sequential scan; it is zero. Why
> bother doing an index scan?
>
> You need at least two more things to happen to provoke Postgres into
> using your index:
>
> 1) Have more entries in the table; rule of thumb is O(100) before an
> index will be used.
>
> 2) Run vacuum after getting that many entries to make sure the optimizer
> will know about the configuration of the tables and indices.

Here's why I'm bringing it up. I ran vacuum on the database yesterday.
The table consists of city, state (both text), lon and lat (both float4).
The text index is working but not the floats. I have another table with
12,000 - 14,000 rows and I'm getting the same thing.

-----

campsites=> explain select lon from locations where lon = 83.5;
NOTICE: QUERY PLAN:

Seq Scan on locations (cost=7263.30 size=2 width=4)

EXPLAIN
campsites=> select count(*) from locations;
count
------
169797
(1 row)

campsites=>

-----

Vince.
--
==========================================================================
Vince Vielhaber -- KA8CSH email: vev(at)michvhf(dot)com flame-mail: /dev/null
# include <std/disclaimers.h> TEAM-OS2
Online Searchable Campground Listings http://www.camping-usa.com
"There is no outfit less entitled to lecture me about bloat
than the federal government" -- Tony Snow
==========================================================================

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleg Bartunov 1998-08-03 12:44:31 number of opened files ?
Previous Message Andreas Zeugswetter 1998-08-03 11:57:46 AW: [HACKERS] Dropping tables...