[ database mysql query ]

Sinisa Milivojevic wrote:

>On Fri, 01 Feb 2002 15:21:07 -0800
>Steve Edberg <[EMAIL PROTECTED]> wrote:
>
>>...perhaps a NEAR function could be added; as a config file or
>>compile-time option, you could define an accuracy range. Say,
>>   ./config --with-epsilon=0.0001
>>
>This is doable of course, but current code does not use any factor.
>The above variant would slow down many operations, while making a few faster.
>
You can always add a UDF to do this - it's not often that anyone would 
want to do indexed lookups of FP quantities. If you do care about 
indexed lookups, you shouldn't be using an inexact type like float anyway.

However, core gurus: this is a good segue to lobby for implementing a 
fixed-point numeric type, like Oracle and other databases do. Such 
fixed-point types are usually stored as BCD,  and there are several good 
BCD manipulation libraries out there. Or the expression evaluation can 
convert BCD into unpacked decimal for a little more speed.

Doing such a type would save *lots* of effort for people trying to do 
financial data manipulation in MySQL, and will save the almost monthly 
FAQ of "how do I represent my monetary data" :-).
--
Shankar.



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to