Skip to Main Content
  • Questions
  • Time required to retrieve data from oracle database

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, israa.

Asked: August 23, 2019 - 11:45 am UTC

Last updated: August 23, 2019 - 7:00 pm UTC

Version: 11.2

Viewed 1000+ times

You Asked

how much time is required to retrieve information from database containing 10M records and the table contains four columns

and Connor said...

That is a very loose question, because it depends on so many things....but here's a trivial example done on an 3 year old laptop

SQL> create table t 
  2  as select rownum x1,rownum x2,rownum x3,rownum x4
  3  from ( select 1 from dual connect by level <= 10000 ),
  4       ( select 1 from dual connect by level <= 1000 );

Table created.

-- scanning but not fetching all the rows

SQL>
SQL> 
SQL> set timing on
SQL> select max(x1) from t;

   MAX(X1)
----------
  10000000

Elapsed: 00:00:00.72

-- fetching every row back to the calling environment

SQL> set timing on
SQL> begin
  2    for i in ( select * from t )
  3    loop
  4       null;
  5    end loop;
  6  end;
  7  /

PL/SQL procedure successfully completed.

Elapsed: 00:00:11.45



Is this answer out of date? If it is, please let us know via a Comment

More to Explore

Performance

Get all the information about database performance in the Database Performance guide.