where rownum < 10 translated by fts

Hello

I have a table with 200 million indexed documents and I thought crawled correctly.  If I SELECT field1 FROM large_table WHERE rownum < 10, it returns 9 entries in a few seconds.  If I select * from large_table where rownum < 10, I get a full table scan. Can someone explain it to me please?

I'm under 11 GR 2, 4 blade cluster.

Thank you

Randy

execution plans tell us many things: in this case, we can see that you go to a partitioned table and that the optimizer uses a full index scan to produce the result for the first query. It is an option, because the v_reference_no column is included in the PKP_DBCR_T index and the optimizer decides to start playback of the structure of the comprehensive index with multiblock read operations to avoid access table completely - basically a systematic index scan full is very similar to a full table scan access the smallest segment index and not the table (even if it is not impossible that an index is greater than the) table but that's another story).

For the second query Oracle uses the full table scan, since it is not possible to read all the necessary information of the index - and the small cost and time values tell us that the optimizer expects that this operation is very cheap and fast. If is not, then this could be a consequence of the empty partition or almost empty with several blocks but a few existing lines: in this case, the engine must analyze many blocks before the stop condition (with the filter stopkey County< 10)="" is="" reached,="" the="" result="" is="" produced,="" and="" the="" scan="" can="" be="">

Tags: Database

Similar Questions

  • Rownum works only where rownum = 1

    Hello
    I have a query that will return the 2 rows:
    SQL> select start_date
      2  from employees join job_history using (employee_id)
      3  where employee_id = 2168
      4  order by start_date desc;
     
    START_DATE
    -----------
    01/04/2004
    02/03/2003
    I wanted to have the first line in this result, so I used rownum and it worked:
    SQL> select x.start_date
      2       from (select start_date
      3             from employees join job_history using (employee_id)
      4             where employee_id = '2168'
      5             order by start_date desc) x -- the first row will be the latest start_date
      6       where rownum = 1;
     
    START_DATE
    -----------
    01/04/2004
    But when I wanted to get the number of line 2, it returns null:
    SQL> select x.start_date
      2       from (select start_date
      3             from employees join job_history using (employee_id)
      4             where employee_id = '2168'
      5             order by start_date desc) x -- the first row will be the latest start_date
      6       where rownum = 2;
     
    START_DATE
    -----------
    Why is this?
    Thank you

    Rownum is applied to the result that the records are returned. So the first record in the result set always has {make: courier new} rownum = 1 {font}. If {make: courier new} rownum = 2 {font} can never be true. This is a discussed [url http://docs.oracle.com/cd/B19306_01/server.102/b14200/pseudocolumns009.htm#i1006297] in the SQL manual.

    It is an old chestnut and the solutions are easily detectable, but they all involve using a nested query to a description.

    select * from
        ( select t.*, rownum as rn
          from your_table t
        )
    where rn = 2;
    

    To have a sorted result set you need two layers of nesting:

    select * from
        ( select t.*, rownum as rn
          from
            (  select * your_table
              order by whatever
            ) t
        )
    where rn = 2;
    

    Cheers, APC

  • where rownum &lt; N is slow

    Hi all

    I'm on a 10.2.0.4 db SE CARS.

    When I run

    Select * from < table > where rownum < N

    The application hangs as if the DBMS must have run a full scan of the table.

    Do you have any idea why this is happening?

    Thanks in advance
  • SELECT... where ROWNUM &gt; 1 does not work?

    Hi all

    We are working to try to finally update some lines on a table that has an application processing threads.
    We are essentially trying to update the value of a field, which he uses to 'mark' which belongs to this process.

    During this operation, we have tried to reset this field on some lines above where he works. We tried to use rownum.

    It did not work, then to try to resolve the problems... we tried just a select base to see if it returns all values to ensure that the rownum would work (don't know why it wouldn't).

    If I try the following I get weird results

    SELECT count (*) from table1.

    Returns as 13000 lines for a charge.

    I do this

    SELECT count (*) from table1 where rownum > 1

    I have no lines.

    The table has 13000 lines inside...

    Now, if I do something like a select col1 from table1 where rownum < 10.
    I get 9 rows...

    I'm intrigued by this...

    This came initially to try to update as I said and he was trying to do something like:

    Update table1 set Field1 = 'value' where rownum between 1000 and 3000.

    No rows updated.

    I have not played with rownum in a while, someone can give me an idea about what is happening here, or some links Info?

    Thanks in advance,

    Cayenne

    Keep in mind, rownum pseudo-column query given the row number in the result of outpup.
    I'll try to resume Oracle doing the test of rownum > 1:
    1. based on your where clause, Oracle will retrieve a line, rownum = 1 (because it's the first row returned), test if it is > 1, it is not, then do not get this line, then rownum back to its previous value, 0
    2 oracle gets another line, rownum = previous value (0) + 1 = 1 (because some lines have been returned yet), test if it is > 1, it is not, then don't you either this line, then rownum back to its previous value, 0
    3 see point 2
    4. Finally, no line is returned because rownum is still stuck on '0 '.

    Nicolas.

  • Any problem with using WHERE ROWNUM = 1?

    DB version: 10 gr 2

    When you want to get a single row of a resultset, is there something wrong in using
     where rownum = 1
     
    as in
     select ename,sal from emp where rownum=1
     

    Nothing wrong but the result is the problem is not deterministic. use of ROWNUM = 1 do not guarantee the same output every time.

  • Where is the translator of firefox

    Firefox has the most efficient translator and now he disappeared and just new Google Translator doesn't do the same thing. I have a dear friend who mother wants to communicate but she does not speak English and the old translator was perfect now the routine is cumbersome and inefficient. Where the old tanslator?

    There are still some versions on the CDN server:

  • How can I fix a printer in Photoshop CC where he said (translated from Swedish) "an error has occurred when the printer was opened (?). The print function is not available until you have selected a printer and reopened a document". I checked that

    Skärmavbild 2016-02-21 kl. 20.52.52 (2).png

    Hi, JTA,.

    Suggest you follow the steps below:

    • Quit and restart Photoshop
    • Open a file to print
    • Go to the file menu > print hover over with your mouse and hold down the SPACEBAR > This will open the menu print and resets the print Photoshop preferences.

    Kind regards

    Claes

  • Rownum and plan to see where Explain the terms &gt; and &lt;

    Hi people...

    I just wanted to share a comment... would make for a conceptual explanation on even!

    SQL > select * from v version $;

    BANNER

    -----------------------------------------------------------------------------

    Database Oracle 12 c Enterprise Edition Release 12.1.0.1.0 - 64 bit Production

    PL/SQL Release 12.1.0.1.0 - Production

    CORE Production 12.1.0.1.0

    AMT for 64-bit Windows: Version 12.1.0.1.0 - Production

    NLSRTL Version 12.1.0.1.0 - Production

    SQL > select count (*) in the tab_rownum where rownum < 2;

    Execution plan

    ----------------------------------------------------------

    Hash value of plan: 1301825293

    --------------------------------------------------------------------------

    | ID | Operation | Name | Lines | Cost (% CPU). Time |

    --------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |            |     1.     2 (0) | 00:00:01 |

    |   1.  GLOBAL TRI |            |     1.            |          |

    |*  2 |   COUNT STOPKEY |            |       |            |          |

    |   3.    TABLE ACCESS FULL | TAB_ROWNUM |     1.     2 (0) | 00:00:01 |

    --------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------                                                                           

    2 - filter(ROWNUM<2)

    Statistics

    ----------------------------------------------------------

    1 recursive calls

    0 db block Gets

    3 consistent gets

    5 physical reads

    0 redo size

    542 bytes sent via SQL * Net to client

    543 bytes received via SQL * Net from client

    2 SQL * Net back and forth to and from the client

    0 sorts (memory)

    0 sorts (disk)

    1 rows processed

    As most of us should be aware of, First_Rows_k optimization takes place for query Rownum... !!

    so for top query, the cardinality estimate is 1 and County stop happened key in the plan with filter as ROWNUM < 2.

    Now let's run under SQL.

    SQL > select count (*) in the tab_rownum where rownum > 2;

    In any case... above SQL will be not all output lines.

    As expected rownum is greater then 2... !!

    allows to check the plan!

    Execution plan

    ----------------------------------------------------------

    Hash value of plan: 141762995

    ---------------------------------------------------------------------------

    | ID | Operation | Name | Lines | Cost (% CPU). Time |

    ---------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |            |     1.   425 (1) | 00:00:01 |

    |   1.  GLOBAL TRI |            |     1.            |          |

    |   2.   COUNTY |            |       |            |          |

    |*  3 |    FILTER |            |       |            |          |

    |   4.     TABLE ACCESS FULL | TAB_ROWNUM | 91740 |   425 (1) | 00:00:01 |

    ---------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    3 - filter(ROWNUM>2)

    Statistics

    ----------------------------------------------------------

    1 recursive calls

    0 db block Gets

    1529 gets coherent

    1526 physical reads

    If we check the cardinality estimates, this is the total of the lines of the table... That's why no First_Rows_K for this SQL optimization. (All_rows)

    Although we will not get all the lines... always full scan table oracle...

    Also... Button Count Stop has changed and filter + Count... !!

    Need to understand... Why not oracle have an output for logic > rownum conditions than zero!

    Why the filter for the second execution ends not SQL executions... it scan complete set... for lines nil!

    Thank you

    Deepak M.

    Hello

    WHERE ROWNUM > 2 is a very common mistake, but it's a mistake that most people make once, in development.  They learn that it does not work, and they don't again.  I expect Oracle to make the features so that unique development queries run faster.  They are probably more concerned about what kind of things people do every day, in the Production.

  • How can I translate from English to the french when I send messages in outlook express 6?

    Original title: translate in Outlook Express 6

    I would like to correspond with my french friends in their language.  How can I translate from English to the french when I send them messages?  A free way to do this would be the best option that I do not send too many french messages to justify a costly option.

    Hi IQuestionU,

    This isn't the functionality of outlook express 6. You might find non-Microsoft Internet program to add this feature. However, we do not recommend to use these programs as Microsoft has not tested its functionality.

    This feature is available in Microsoft Office outlook. For more information, see the following articles:
    1 see How to use the word in a message in Outlook
    2 see where are the translation options?

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Rownum and order of columns not indexed

    Why ROWNUM continue to take the same cost?

    Why can't you see no difference between the ORDER of SORTING BY STOPKEY and just SORT ORDER BY?

    SQL_ID, 9vccbf2dtazuq, number of children 0

    -------------------------------------

    Select * from (select * from PROCESS_MESSAGE by id) where

    rownum < 101

    Hash value of plan: 2507589572

    ------------------------------------------------------------------------------------------------------

    | ID | Operation | Name               | Lines | Bytes | TempSpc | Cost (% CPU). Time |

    ------------------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |                    |       |       |       |  1252K (100) |          |

    |*  1 |  COUNT STOPKEY |                    |       |       |       |            |          |

    |   2.   VIEW                  |                    |    26 M |    40G |       |  1252K (1) | 00:00:49 |

    |*  3 |    SORT BY STOPKEY ORDER.                    |    26 M |  4736M |  5835M |  1252K (1) | 00:00:49 |

    |   4.     TABLE ACCESS FULL | PROCESS_MESSAGE |    26 M |  4736M |       |   170K (1) | 00:00:07 |

    ------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    1 - filter(ROWNUM<101)

    3 - filter(ROWNUM<101)

    SQL_ID, 2zwdanc062902, number of children 0

    -------------------------------------

    Select * from PROCESS_MESSAGE by id

    Hash value of plan: 1046773234

    -------------------------------------------------------------------------------------------------

    | ID | Operation | Name               | Lines | Bytes | TempSpc | Cost (% CPU). Time |

    -------------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |                    |       |       |       |  1252K (100) |          |

    |   1.  SORT ORDER BY |                    |    26 M |  4736M |  5835M |  1252K (1) | 00:00:49 |

    |   2.   TABLE ACCESS FULL | PROCESS_MESSAGE |    26 M |  4736M |       |   170K (1) | 00:00:07 |

    -------------------------------------------------------------------------------------------------

    Cost is not something that I want to live. Here's a simple example. Search for the-row, A-Time and memory usage for the SORT operation on both the query to see the difference.

    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> create table t as
      2  select rpad ('x', 1000, 'x') str from dual
      3  connect by level <= 10000;
    
    Table created.
    
    SQL> exec dbms_stats.gather_table_stats(user, 'T')
    
    PL/SQL procedure successfully completed.
    
    SQL> alter session set statistics_level = all
      2  ;
    
    Session altered.
    
    SQL> @temp.txt
    
    PLAN_TABLE_OUTPUT
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    SQL_ID  c4qj1q3h9kkyy, child number 0
    -------------------------------------
    select * from t order by str
    
    Plan hash value: 3672837129
    --------------------------------------------------------------------------------------------------------------------------------------------------------
    | Id  | Operation          | Name | Starts | E-Rows |E-Bytes|E-Temp | Cost (%CPU)| E-Time   | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
    --------------------------------------------------------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT   |      |      1 |        |       |       |  2018 (100)|          |  10000 |00:00:00.25 |    1433 |       |       |          |
    |   1 |  SORT ORDER BY     |      |      1 |  10000 |  9775K|     9M|  2018   (1)| 00:00:20 |  10000 |00:00:00.25 |    1433 |    11M|  1285K|    9M (0)|
    |   2 |   TABLE ACCESS FULL| T    |      1 |  10000 |  9775K|       |   225   (1)| 00:00:03 |  10000 |00:00:00.02 |    1433 |       |       |          |
    --------------------------------------------------------------------------------------------------------------------------------------------------------
    
    14 rows selected.
    
    PLAN_TABLE_OUTPUT
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    SQL_ID  8a53npuzuxxj5, child number 0
    -------------------------------------
    select * from (select * from t order by str) where rownum <= 50
    
    Plan hash value: 1317717595
    -------------------------------------------------------------------------------------------------------------------------------------------------------------
    | Id  | Operation               | Name | Starts | E-Rows |E-Bytes|E-Temp | Cost (%CPU)| E-Time   | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
    -------------------------------------------------------------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT        |      |      1 |        |       |       |  2018 (100)|          |     50 |00:00:00.08 |    1433 |       |       |          |
    |*  1 |  COUNT STOPKEY          |      |      1 |        |       |       |            |          |     50 |00:00:00.08 |    1433 |       |       |          |
    |   2 |   VIEW                  |      |      1 |  10000 |  4902K|       |  2018   (1)| 00:00:20 |     50 |00:00:00.08 |    1433 |       |       |          |
    |*  3 |    SORT ORDER BY STOPKEY|      |      1 |  10000 |  9775K|     9M|  2018   (1)| 00:00:20 |     50 |00:00:00.08 |    1433 | 61440 | 61440 |55296  (0)|
    |   4 |     TABLE ACCESS FULL   | T    |      1 |  10000 |  9775K|       |   225   (1)| 00:00:03 |  10000 |00:00:00.01 |    1433 |       |       |          |
    -------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
       1 - filter(ROWNUM<=50)
       3 - filter(ROWNUM<=50)
    
    22 rows selected.
    

    Edited...

    Looking for more, if you see the lines-E in the second request its 10000 for SORTING display. But the row that is the true value is 50. Maybe this could be a factor why the cost of both the request are the same.

  • rownum

    Hi all

    I use

    Connected to Oracle Database 11g Express Edition Release 11.2.0.2.0

    I use the Oracle HR schema

    I'm learning the rownum with order of

    In the two order statement is in even

    but a 2nd has ROWNUM < 6

    The result set is different

    Please help me understand the problem

    SQL > SELECT LAST_NAME, HIRE_DATE

    2 EMPLOYEES

    3 ORDER OF HIRE_DATE

    4;

    LAST_NAME HIRE_DATE

    ------------------------- -----------

    De Haan 13/01/2001

    Gietz 06/07/2002

    Baer 06/07/2002

    Mavris 06/07/2002

    Higgins 07/06/2002

    Faviet 16/08/2002

    SQL > SELECT LAST_NAME, HIRE_DATE

    2 EMPLOYEES

    3. WHERE ROWNUM < 6

    4 ORDER OF HIRE_DATE

    5;

    LAST_NAME HIRE_DATE

    ------------------------- -----------

    De Haan 13/01/2001

    King 17/06/2003

    Kochhar 21/09/2005

    Hunold 03/01/2006

    Ernst 21/05/2007

    Thank you

    Hello

    second one you 5 random * (in theory at least) the lines you sort. If you need to sort the rows and get top 5 can do sorting in inline mode and which filter with rownum<>

    -- without ordering 5 rows
    SELECT LAST_NAME,HIRE_DATE
    FROM EMPLOYEES
    WHERE ROWNUM < 6
    ;
    -- order those 5 rows
    SELECT LAST_NAME,HIRE_DATE
    FROM EMPLOYEES
    WHERE ROWNUM < 6
    ORDER BY HIRE_DATE
    ;
    -- select all employees, sort them and then return top 5 of them
    SELECT * FROM (
      SELECT LAST_NAME,HIRE_DATE
      FROM EMPLOYEES
      ORDER BY HIRE_DATE
    )
    WHERE ROWNUM < 6
    ;
    
    LAST_NAME                 HIRE_DATE
    ------------------------- ----------
    King                      17.06.2003
    Kochhar                   21.09.2005
    De Haan                   13.01.2001
    Hunold                    03.01.2006
    Ernst                     21.05.2007 
    
    LAST_NAME                 HIRE_DATE
    ------------------------- ----------
    De Haan                   13.01.2001
    King                      17.06.2003
    Kochhar                   21.09.2005
    Hunold                    03.01.2006
    Ernst                     21.05.2007 
    
    LAST_NAME                 HIRE_DATE
    ------------------------- ----------
    De Haan                   13.01.2001
    Mavris                    07.06.2002
    Gietz                     07.06.2002
    Higgins                   07.06.2002
    Baer                      07.06.2002 
    

    * randomly in this context means that there is no particular order what rows is returned. If the query is repeated, it seems that the lines in the same order each time, but this could change when data is modified in the table.

  • Using ROWNUM with SEQUENCE. NEXTVAL in the select statement

    I have a table emp

    SQL > select * from emp;

    EMPNO, ENAME

    ---------- ----------

    JOHN 5000

    5001 ADAM

    MIKE 5002

    I need help to write a procedure to run ' select EMPNO | ENAME from emp' on a line at a time until the end of the table.

    Try to use the below stated by "N as a sequence.nextval. It does not work. Please help me solve this.

    Select EMPNO | ENAME from EMP

    where rownum < N + 1

    less

    Select EMPNO | ENAME from EMP

    where rownum < N;

    So why not just make something like:

    SQL > select "mysql - host = localhost - user = roor - password = rootpassword e ' create database ' |" " EmpNo | Ename | " » ;"
    2 EMP;

    "MYSQL - HOST = LOCALHOST - USER = ROOR - PASSWORD = ROOTPASSWORD-E" CREATEDATABASE'| "" EMPNO | ENAME | " » ;"
    -------------------------------------------------------------------------------------------------------------------
    MySQL--host = localhost - user = roor - password = rootpassword EI 'create the 7369SMITH database';
    MySQL--host = localhost - user = roor - password = rootpassword EI 'create the 7499ALLEN database';
    MySQL--host = localhost - user = roor - password = rootpassword EI 'create the 7521WARD database';
    MySQL--host = localhost - user = roor - password = rootpassword EI 'create the 7566JONES database';
    MySQL--host = localhost - user = roor - password = rootpassword EI 'create the 7654MARTIN database';
    MySQL--host = localhost - user = roor - password = rootpassword EI 'create the 7698BLAKE database';
    MySQL--host = localhost - user = roor - password = rootpassword EI 'create the 7782CLARK database';
    MySQL--host = localhost - user = roor - password = rootpassword EI 'create the 7788SCOTT database';
    MySQL--host = localhost - user = roor - password = rootpassword EI 'create the 7839KING database';
    MySQL--host = localhost - user = roor - password = rootpassword EI 'create the 7844TURNER database';
    MySQL--host = localhost - user = roor - password = rootpassword EI 'create the 7876ADAMS database';
    MySQL--host = localhost - user = roor - password = rootpassword EI 'create the 7900JAMES database';
    MySQL--host = localhost - user = roor - password = rootpassword EI 'create the 7902FORD database';
    MySQL--host = localhost - user = roor - password = rootpassword EI 'create the 7934MILLER database';

    14 selected lines.

    SQL >

    Then, you can copy and paste the results in a script file and run this script.

    Don't know why you want to wait 15 seconds between each, as the mysql command is not likely to return control to the script until it has finished creating the database (at least that's what would make most of the commands, I use MySQL)

  • order by with rownum

    Hi Hello all please help me I want to choose folder 100 100000 record Albums, but my answer to the query is too slow. Please give me an idea to improve this issue.

    Select *.

    from (SELECT *)

    of dhcpactivitylogs

    WHERE CREATEDDATE BETWEEN

    18 NOVEMBER 14 1.00.00 AM'

    AND

    21 NOVEMBER 14 12.00.00 PM'

    dhcpactivitylogsid desc order)

    where rownum < = 100;

    If im using simple rownum works it random return 100 and I need top 100.

    If there are indexes on (DHCPACTIVITYLOGSID, CREATEDDATE) and the query is changed, a little bit like below, you should see "stop key" somewhere in the plan which comes only 100 lines in the order of the index.

    Select *.

    from (SELECT t.*, rownum rn

    of dhcpactivitylogs t

    WHERE CREATEDDATE BETWEEN

    18 NOVEMBER 14 1.00.00 AM'

    AND

    21 NOVEMBER 14 12.00.00 PM'

    dhcpactivitylogsid desc order)

    -where rownum<=>

    where rn<=>

  • How to cancel the limit rownum &lt; 1234...

    Hello

    I connect via the ODBC connection pool to the Vertica (HP) database.

    Vertica SQL does not work with the operator "rownum <...» ».

    But OBIEE generate instructions SQL DB, according to ResultRowLimit definition.

    For example:

    Select D1.c1 as D1.c2 as D1.c3 as D1.c4 as c1 c2 c3 c4

    (separate select 0 as c1,

    D1. C1 C2

    D1. C2 as c3,

    D1. C3 as c4

    Of

    (select T380477. PERIOD_NAME C1,

    T380477. PERIOD_NUM C2,

    T380477. PERIOD_ID as c3

    of XXBI_DIM_GL_PERIODS T380477

    ) D1

    order of c4, c3) D1

    where rownum < = 1000000000

    So the question is: is it possible to cancel the rownum limit?

    Thank you

    Ark

    Have you tried to disable ROWNUM_SUPPORTED in the features of the physical layer data base? Implementation of database objects and the Pools of connections - 11 g Release 1 (11.1.1)

  • SQL performance problem associated with rownum.

    Dear Experts,

    I have a sql

    SELECT TEMP.col1, TEMP.col2, TEMP.col3, TEMP.col4, TEMP.col5, ROWNUM, not

    (SELECT col1, col2, col3, col4 FROM table1 ORDER BY DESC col4 col5) TEMP WHERE rownum between? and?

    When I put the value of range rownum 1 and 100, it works very well. But when I put 101 and 200 no records returned.

    So I modified it as fllows

    SELECT TEMP.col1, TEMP.col2, TEMP.col3, TEMP.col4, TEMP.col5,NWR No. OF

    (SELECT col1, col2, col3, col4, col5, rownum NWR FROM table1 ORDER BY DESC col4) TEMP WHERE NWR between? and?

    It works fine and giving results desire. But the issue here is the modified SQL becomes very slow. It gives results in 20 minutes. Although SQL earlier gave results in a few seconds.

    Records in table1 is 40 million.

    Is there another way to get good performance results accurate?

    Your help will be much appreciated.

    Kind regards

    DD

    Hi try this... If you want that data should be in the specific order (as order by desc col4, then you can use analytical ROW_NUMBER() function as below). Try it out below and let me know in case of any problems

    SELECT TEMP.col1,

    TEMP.col2,

    TEMP.col3,

    TEMP.col4,

    TEMP.col5,

    NWR NO.

    FROM (SELECT col1,

    col2,

    col3,

    COL4,

    col5,

    ROW_NUMBER() over (ORDER BY DESC of col4) rno

    FROM table1)

    NWR WHERE between 101 AND 200;

    (GOLD)

    SELECT TEMP.col1,

    TEMP.col2,

    TEMP.col3,

    TEMP.col4,

    TEMP.col5,

    NWR NO.

    FROM (SELECT col1,

    col2,

    col3,

    COL4,

    col5,

    ROW_NUMBER() OVER(ORDER BY col4 DESC) NWR

    FROM table1)

    WHERE NWR<=>

Maybe you are looking for

  • Satellite A100 (PSAA8): need driver for video controller

    Hello I bought a new Satellite A100 (PSAA8) and re-installed Windows XP Pro. I downloaded some drivers including Intel Display Driver and Flash Media Driver, etc. from the web and installed. But I can't find the driver for video controller, so I stil

  • Is possible on Satellite L300-21W graphics card updated?

    Hello! I think buy Toshiba Satellite L300-21W, but I want to play games on it like Cod2 but I think his series graphics card is weak, so my question is:"I CAN REPLACE GRAPHIC CARD WITH BETTER ONE or NOT (and with that one, if you know)"! "" Thank you

  • How to unlock locked blackBerry 9000 SFR smartphones?

    Hi all! I have huge problem - I need to unlock my old blackberry Bold 9000. I got it when I lived in France, but now use another operator in other countries. And my new blackberry is stolen, and I have to use an old. How can I get the unlock code? I

  • JavaFX how to use WebView load the local HTML page?

    JavaFX how to use WebView load the local HTML page?

  • I am trying to extrude a shape.

    Why I do not see the geometry category in my bed after I click the cube icon to make the 3D layer? If you still see that with the follow-up of the CPU or is it because I have no CUDA and Nvidia GPU tracing or something else?