Return-Path: owner-postman
Received: from localhost (localhost [127.0.0.1]) by nobozo.CS.Berkeley.EDU (8.6.4/8.6.3) with SMTP id PAA29264 for postgres-dist; Mon, 29 Nov 1993 15:05:37 -0800
Resent-From: POSTGRES mailing list <postman@postgres.Berkeley.EDU>
Resent-Message-Id: <199311292305.PAA29264@nobozo.CS.Berkeley.EDU>
X-Authentication-Warning: nobozo.CS.Berkeley.EDU: Host localhost didn't use HELO protocol
Sender: owner-postman@postgres.Berkeley.EDU
X-Return-Path: owner-postman
Received: from cs.uml.edu (cs.uml.edu [129.63.1.11]) by nobozo.CS.Berkeley.EDU (8.6.4/8.6.3) with SMTP id PAA29255 for <postgres@nobozo.CS.Berkeley.EDU>; Mon, 29 Nov 1993 15:05:36 -0800
Received: by cs.uml.edu id AA11959
  (5.67a+/IDA-1.5 for postgres@nobozo.CS.Berkeley.EDU); Mon, 29 Nov 1993 18:05:33 -0500
From: John Peter Lee <jlee@cs.uml.edu>
Message-Id: <199311292305.AA11959@cs.uml.edu>
Subject: building indices on float4's...
To: postgres@postgres.Berkeley.EDU
Date: Mon, 29 Nov 1993 18:05:32 -0500 (EST)
Cc: jlee@cs.uml.edu (JP Lee)
X-Mailer: ELM [version 2.4 PL22]
Content-Type: text
Content-Length: 2098      
Resent-To: postgres-dist@postgres.Berkeley.EDU
Resent-Date: Mon, 29 Nov 93 15:05:37 -0800
Resent-XMts: smtp

Hi:

   I don't think my previous message made it, so here goes again...

   I've built my DB, and defined indexes on a certain relation. The 
   values are float4's between 0.0 and 1.0. There are ~260 distinct
   values, and a total of 55,000 entries in all for this particular
   field. I built a btree index on this field, using the float4_ops
   operator.

   Now I am trying to issue some very simple queries using this field,
   and am getting anomalous results. I am not getting anything back in
   my results when issuing queries that I know should.

   First, I tried a very simple query:

* retrieve (comp_real_data.id_number)
where comp_real_data.date > 0.5
\g

Query sent to backend is "retrieve (comp_real_data.id_number)   where
comp_real_data.date > 0.5 "
NOTICE:Nov 29 17:59:50:there is no operator > for types float4 and float8
NOTICE:Nov 29 17:59:50:You will either have to retype this query using an
NOTICE:Nov 29 17:59:50:explicit cast, or you will have to define the
       operator
WARN:Nov 29 17:59:50:> for float4 and float8 using DEFINE OPERATOR



  this might have something to do with not having quotes around the 
  floating point number. What does this notice mean, and how would I
  perform an explicit cast ??? The manual says that the btree ops exist
  for float4s. It this true ???
  
  
  So then I tried:

* retrieve (comp_real_data.id_number)
  where comp_real_data.date > "0.5"\g

  Query sent to backend is "retrieve (comp_real_data.id_number)   where
  comp_real_data.date > "0.5""
  ---------------
  | id_number   |
  ---------------


  Nothing. I know that there should be at least 100 values returned.


  Is there anything wrong with building btrees on floating point numbers?

  thanks,

  jp

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
JP Lee               Institute for Visualization and Perception Research	
jlee@cs.uml.edu                    University of Massachusetts at Lowell 
(508) 934-3384			      1 University Ave. Lowell, MA 01854

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
