Indexing of typical BINARY_FLOAT NaN values

I'm indexing NaN values for a column that is BINARY_FLOAT types, but it does not use the index for NaN values - but it will use the index for non - NaN values.
create table nan (id binary_float) ;

begin
     for x in 1 .. 10000
     loop
         if ( mod( x, 10 ) ) = 0 THEN          
           insert into nan values(x) ;
        else
          insert into nan values(binary_float_nan) ;
       end if ;
     end loop ;
     commit ;
end ;
/

create index nan_id_i on nan(id) compute statistics ;
Set autotrace on explain
Select the id of nan where id is nan;

--------------------------------------------------------------------------
| ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |
--------------------------------------------------------------------------
| 0 | SELECT STATEMENT | 9901. 39604 | 6 (0). 00:00:01 |
|* 1 | TABLE ACCESS FULL | NAN | 9901. 39604 | 6 (0). 00:00:01 |
--------------------------------------------------------------------------

I tried to use a trick, but I get the same result.
Select / * + INDEX (n, nan_id_i) * / nan id n where id is nan

But it will use the index for values of non_NaN:

Select the id of nan where id = 20;

-----------------------------------------------------------------------------
| ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |
-----------------------------------------------------------------------------
| 0 | SELECT STATEMENT | 1. 4. 1 (0) | 00:00:01 |
|* 1 | INDEX RANGE SCAN | NAN_ID_I | 1. 4. 1 (0) | 00:00:01 |
-----------------------------------------------------------------------------

Any suggestions to get Oracle to use the index of Nan values?

For what it's worth, when I use "WHERE ID = BINARY_FLOAT_NAN" (but not "WHERE ID IS NAN"), the execution plan uses the index, as in:

SQL> create table nan (id binary_float) ;

Table created.

SQL> -- 5 rows out of 10000 with NaN values
SQL> begin
  2               for x in 1 .. 10000
  3               loop
  4                      if  x in (100,200,300,400,500) THEN
  5                        insert into nan values(binary_float_nan) ;
  6                     else
  7                       insert into nan values(x) ;
  8                    end if ;
  9             end loop ;
 10            commit ;
 11         end ;
 12        / 

PL/SQL procedure successfully completed.

SQL>
SQL> create index nan_id_i on nan(id) compute statistics ;

Index created.

SQL> set autotrace on explain
SQL> select id from nan where id is nan ;

        ID
----------
       Nan
       Nan
       Nan
       Nan
       Nan

Execution Plan
----------------------------------------------------------
Plan hash value: 1740821685

--------------------------------------------------------------------------
| Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |     5 |    20 |     6   (0)| 00:00:01 |
|*  1 |  TABLE ACCESS FULL| NAN  |     5 |    20 |     6   (0)| 00:00:01 |
--------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter("ID" IS NAN)

Note
-----
   - 'PLAN_TABLE' is old version
   - dynamic sampling used for this statement

SQL> select id from nan where id = binary_float_nan;

        ID
----------
       Nan
       Nan
       Nan
       Nan
       Nan

Execution Plan
----------------------------------------------------------
Plan hash value: 911448673

-----------------------------------------------------------------------------
| Id  | Operation        | Name     | Rows  | Bytes | Cost (%CPU)| Time     |
-----------------------------------------------------------------------------
|   0 | SELECT STATEMENT |          |     5 |    20 |     1   (0)| 00:00:01 |
|*  1 |  INDEX RANGE SCAN| NAN_ID_I |     5 |    20 |     1   (0)| 00:00:01 |
-----------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access("ID"=BINARY_FLOAT_NAN)

Note
-----
   - 'PLAN_TABLE' is old version
   - dynamic sampling used for this statement

If 'WHERE ID = BINARY_FLOAT_NAN' is also semantically correct like "WHERE ID IS NAN" can be subject to discussion...

Tags: Database

Similar Questions

  • How can I delete a table NaN values?

    I'm testing if an array values are less than 0.001. They are all... BUT the problem is that some of the elements of the array are NaN values. I want to do two things:

    1 remove NaN of the array elements and put them to zero to make the test work.

    2 to understand that NaN elements are tested.

    The results in an array of Boolean values of T, F. If all the values of the boolean chart are T, resulting in a single Boolean value of t. # 2, I I want to test if an element of the array is less than OR equal to 0.001 NAN.

    twolfe13 wrote:

    I'm testing if an array values are less than 0.001. They are all... BUT the problem is that some of the elements of the array are NaN values. I want to do two things:

    1 remove NaN of the array elements and put them to zero to make the test work.

    Various positions have been in the past to the deletion of items in a table. I'm sure that you took the time to research before you posted, right? In any event it seems not that order is important here, so the best way to proceed is to sort the array and then search for the first occurrence of NaN. Just do a comparison on the subset of the front table of this index.

    2 to understand that NaN elements are tested.

    The results in an array of Boolean values of T, F. If all the values of the boolean chart are T, resulting in a single Boolean value of t. # 2, I I want to test if an element of the array is less than OR equal to 0.001 NAN.

    Use the Boolean function gold and the function of Not a number/path/Refnum .

  • Anova 1 d return NaN values

    I have this vi, in which I want to use an anova 1 d, but I always get NaN values. I tried the example here: http://forums.ni.com/t5/LabVIEW/1D-ANOVA/td-p/702716/page/2, but I still can't make it work.

    Can someone help me please?

    Thank you.

    The table connected to the entrance of the ANOVA.vi D 1 index contains only zeros. Your case statement strange within the structure of the event, which always adds 1-1 regardless of the value of i is a specific candidate for the thread code Rube Goldberg.

    You have a lot of duplicated code, fan, hard to follow the wires twisted, and records the unused shift.

    Do not use the button abandon to stop your VI. Place a Stop boolean on the front panel and it wire end of the Terminal loop. It is not considered polite to postal code with infinite loops.

    Lynn

  • NaN values in table

    Hello

    I got a code made by my colleague who is no longer with us. In a column of table 8 and not generated by program. lines to initialize all values such as NaN values. I've never met before NaN values.

    Research, I understand this isn't a number, but it's not really make much sense to me. Why the table cells are written as NaN? What is the meaning of NaN? Can I leave empty cells and not showing no no NaN inside?

    Kind regards

    Austin

    Ok. Yes, I now understand the meaning. So if I create a table in the future and I want to configure a few lines to NaN values. How can I do. Is there a constant called NaN?

  • Analysis.Math.Statistics fails when NaN values are included in the entry tables

    Hi all..

    With the help of Measurement Studio to Version 8.9 of .net. We need calculate statistics on a table that contains a double. NaN values. When I do this I get NaN as the result of any of the statistical methods (average, STDS etc.) ... Interestingly, the Math.ArrayOperations methods look like they work. Any ideas?

    Thank you

    gdssoftware

    Hi GDSSoftware,

    You see this behavior because the statistical functions with Measurement Studio ignore not input values NaN - that is why, they will return results NaN.  To work around this problem, you will need to filter these NaN values out of your input array before performing statistical analysis on this subject.

    If you're working with .NET 3.5 and later versions, you can do this by using the following:

    Double [] vals = new double [] {0d, 6 d, 10 d, 4 d, double. NaN};
    Double [] nanless_vals = vals. Where (d =>! double.) IsNaN (d)). ToArray();

    If you use an earlier version of the .NET framework, you will need to perform a loop on the table with the following (or something similar):

    Double [] vals = new double [] {0d, 6 d, 10 d, 4 d, double. NaN};
    List nanless_list As new List();
    for (int i = 0; i)< vals.length;="">
    If (! double.) IsNaN (vals [i]))
    nanless_list. Add (Vals [i]);
    Double [] nanless_vals is nanless_list. ToArray();

    I hope this helps!

    Kind regards

    Stephanie R.

    National Instruments

  • An update on an index column with the same value generates an index to the top

    An update on an index column with the same value generates an update of the index?


    Thank you

    In addition to my previous answer, see also

    http://orainternals.WordPress.com/2010/11/04/does-an-update-statement-modify-the-row-if-the-update-modifies-the-column-to-same-value/

    Riyaj Shamsudeen has this to say:
    "+ We have an index on this column v1 and we update this column indexed too." Oracle was updating the indexed column? N ° if the values match the level of the indexed column, then the code of RDBMS isn't up-to-date index, a feature for optimization again. Only the row of table is updated, and the index is not updated. + "

    Hemant K Collette

  • Retrieve XDB$ index not the text ENUM_T values

    All,

    I have a type xdb xml element $ enum_t where I can't find a way to get the text associated with the index value. The only way I seem to be able to get the index value is through the point object relationship (.value) notation. It gives me the index value of the list of restriction. I saw another post referring to the same question, but never responded. I need this xml element limited by this list. Any help or ideas appreciated. I'm using Oracle 11 g.

    Thank you

    Tom

    Hi Tom,

    It is not the right approach for what you are trying to reach.

    XDB$ ENUM_T is internal stuff that is not intended to be handled directly.

    Always use the XQuery/XPath functions to access the node values.

    I need this xml element limited by this list.

    What you mean?

    Object-relational storage via an XML schema that you use? If so, what is the problem?

    Could you put a small suitcase to test?

    Thank you.

  • A NaN value make invisible?

    I have a form that has several calculations on it and one of them is from a calculated field is divided by another. The problem I have is that they start with zeros before the numbers being entered. Because of this, the 0 divided by 0 is a NaN (not a number) value that is shown on my form. This causes of questions posed by the impatient and the ignorant about why there is "NaN" on their form. Once the numbers have been entered on the forms, the value is automatically calculated and we're all good with numbers.

    With all that said, is there a way to not show the value NaN?  I tried to enter '0' as a default, but that has not worked and I'm all out of ideas. I'm not great writing scripts, but can take things quite easily. Any help would be appreciated. Thank you!

    Adobe Acrobat 9 Standard

    Windows XP

    If you do the math with a script, simply test if v2 is not

    zero before trying diving that she...

    If (v2 == 0) event.value = "";

    else event.value = v1 / v2;

  • can we create an index only for a given value in a column?

    desc TAB_A
    -----------------
    id1  Number Primary key,
    id2  Number,
    col1 varchar2(10),
    col2 varchar2(10)
    
    
    
    select count(*) from TAB_A
    --------------------
    4587609
    
    select count(*) from TAB_A where id2=10 
    ------------------
    6000
    
    Here is my question
    
    
    can i create an index only for the cloumn id2 only for the value 10?
    Thank you
    Mike

    Hi, Mike,.

    You can have a function-based index.

    CREATE INDEX tab_a_id2_10 ON tab_a
    (   CASE
            WHEN  id2 IN (10)
            THEN  id2
        END
    );
    

    In Oracle 11.2, it might be cleaner to have a virtual column (indexed).

  • NumericStepper with stepSize = 0,1 the NaN value

    I have a spark NumericStepper:

    < s:NumericStepper value = "0" stepSize = "0.1" / >

    When I first click on the NumericStepper component to increment the value, it goes from "0" to "0.1", it's ok.

    But when I click again to increment or decrement, it displays "NaN".

    To debug the NumericStepper and it seems that my default locale is fr_FR and waits as the decimal separator ',' instead of '. '.

    But if I try to put stepSize = '0.1' I have a compilation error because 0.1 cannot be cast as a number.

    Is this a bug? is there a work around to have a french decimal stepSize with locale?

    There are really two separate issues:

    (1) halo NumberValidator error validation for decimal values when locale is set to fr_FR

    (2) Spark NumericStepper doesn't change separator decimal, based on locale

    I will file a separate issue for the issuance of NumberValidator Halo.  Introduced by Bill can be used to track the decimal separator not changing not based on the locale.

    To work around the problem, you can change the way the value is displayed by the NumericStepper component using the valueFormatFunction and the valueParseFunction.

    For example, the following text replaces the "." decimal separator with a «,»


    private void myFormatFunc(val:Number):String
    {
    Return val.toString ().replace(".",",");
    }

    private void myParseFunc(val:String):Number
    {
    var stringVal:String = val.replace (",",".");
    Return Number (stringVal);
    }
    ]]>

  • PlotXY does not not for tables including NaNs

    Hello

    work on this issue (as usual), I was using the PlotXY command for debugging, as follows:

    plot_handle = PlotXY (panel_handle, PANEL_GRAPH, x, y_l, 1001, VAL_DOUBLE, VAL_DOUBLE, VAL_THIN_LINE, VAL_NO_POINT, VAL_SOLID, 1, VAL_RED);

    Nothing spectacular, in addition to the fact that the plot shows only zeros if the table includes NaNs.

    It's (at least) a feature without papers...

    If the data table consists of say 100 NaNs and 900 valid numbers, the function to show 900 valid numbers, I would have expected. Also, we could assume a mistake, but the function returns a valid handle plot.

    Not there at - it no the ability to display valid numbers?

    Thank you

    Wolfgang

    Wolfgang,

    The expected behavior is that the valid points are drawn and the NaNs are ignored. But note that, if you choose a line plot, you must have at least two consecutive points of valid, otherwise you won't see any line segment at all. You could get a better view if you use VAL_CONNECTED_POINTS or VAL_SCATTER.

    In addition, NaNs don't contribute to the new limits of the axis, if your axles are autoscaled. Your range of the x-axis appears to be (-10,0.8). If it is autoscaled, what could be the extent of your data x, given that valid points? And everything that you are valid values are 0? Note that NaNs should simply be ignored - they must not become 0. Therefore, a flat line of zeroes is certainly unexpected.

    In addition, since it is an XY plot, all it takes is for one of the two values to a given index to be a NaN value for all of the point to be ignored.

    Luis

  • Replace the index of an array with strings values

    I have a control table 2D (or indicator) CH x T: each cell of the table contains the voltage check for channel and time represented by the respective row and column.

    I would like to be able to scroll the data showing the names and time values to the Index screen instead of numeric values.

    For example, instead of see 0,1,2,3 etc. as line index values, I would like to see channel 1, canal2, canal3 etc..

    Is - it somehow possible?

    Any idea is welcome!

    Thank you in advance!

    See you soon.

    MG

    If you want to display the data in the form of a 2D array, but use channel & time as the Index display, you can use the rings of text and structure of the event.  You can reduce the table view if you only want to display one value.

  • Search index of the secuence valuation until you reach a constant value table...

    Hello

    I have an arry of secuence RR values (its peak at the time of peak of ECG wave is seconds). I know that the added value of the paintings is the total time of sample data.

    I would like to separate in different charts in the representation of every hour of recorded data.

    I need to get a way to get the index where the number of added values are-online 3600 s (1 h).

    So that I can know the index of the arrays values to get the correct index in chart 1 h values, another index for another hour for an another graph,... so until you get the hourly chart several data can show.

    I hope you understand me.

    Best regards.

    Modulo division is performed by the function Quotient & remains on the digital palette.

    Work with tables and data DBL or integer types.

    When I use the method that Mike designed, in my view, the VI sometimes lacks a time transition. This happens with the simulated data that I generate because it is possible that the rest is different from zero. For example, this can happen if the accumulated sum is 3599.4 s and the next RR interval is 1.3 s. Which gives the following sum = 3600.7 s. The conversion by multiples of the amounts of 3599 and 3601. The remains are 3599 and 1 after modulo division. None are exactly equal to zero.

    I've changed this option to use DBL and then look the big negative transition. The minimum value may be with the largest range of RR in the data. However, there is always a great transition close to 3600 to near zero.

    Lynn

  • In my table there are some values as inf and Nan, before to save my table I want to eliminate these values. How can I do this?

    In my esperiments I get certain values such as the inf and Nan and I want to eliminate these values before you save my table in a file because then I would take the average of those values that are stored in a file

    How can I do this?

    Thank you

    Here's a quick example:

    Make sure you use not A number/path/Refnum? Function, because direct comparisons with for example a diagram NaN constant could give surprising (for some) results. For example, you think you could add a NaN value to the constant table diagram and remove some code, it is not working properly.

    (Of course if you have an older version of LabVIEW, you might not have the conditional tunnel. In such a case, it should be a bit more code in view)

  • sending of lov index instead of the value of display or code

    Hi I have a situation where the value of transition from am to my human workflow, my problem is everything they value that i beign selected through lov sending lov index instead of the actual value, for example when I select my lov instead of displaying the name of the country sendinding country it send this lov index i.e. 1
    my pagedef is 
    
    <list IterBinding="IntUsr1Iterator" StaticList="false"
              Uses="LOV_Countrycode" id="Countrycode" DTSupportsMRU="true"/>
    
    
    <methodAction id="approveUser" InstanceName="InternalUserAppDC"
                      DataControl="InternalUserAppDC" RequiresUpdateModel="true"
                      Action="invokeMethod" MethodName="approveUser"
                      IsViewObjectMethod="false">
    <NamedData NDName="country_of_origin"
                     NDValue="#{bindings.Countrycode.inputValue}"
                     NDType="java.lang.String"/>
    
     </methodAction>
    
    
    lov
    <af:selectOneChoice value="#{bindings.Countrycode.inputValue}"
                                  shortDesc="#{bindings.Countrycode.hints.tooltip}"
                                  id="soc3" simple="true">
                <f:selectItems value="#{bindings.Countrycode.items}" id="si3"/>
              </af:selectOneChoice>
    how can i pass selected value instead of input value
    Edited by: adf009 2013/05/07 10:55

    Published by: adf009 on 07/05/2013 10:56

    Hello

    I don't know much on the task list and its flow. But I guess that

    ...
    
    
    ....
    

    should be

    ...
    
     ....
    

    I've already shared it, but once again... Can go you through the get value selected SOC link

    -Neha...

Maybe you are looking for