Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Endless query??

Status
Not open for further replies.

AlexTardif

Programmer
Apr 11, 2002
14
CA
Hey there,

I got a table which has around 2 millions inserts each day (which means more than 20 inserts each second). Also, this table has a timestamp field.

What will happen to this query? Will it run endlessly?

SQL:
SELECT COUNT(*)
FROM my_table
WHERE TS_FIELD > '2016-02-01 00:00:00.000000'

Thanks for your answers!

Alex
 
No. When you submit the query, Oracle notes the time and uses the (internal Oracle) timestamp on each Oracle row to determine the rows that meet your criteria.

==================================
adaptive uber info galaxies (bigger, better, faster, and more adept than cognitive innovative agile big data clouds)


 
Note: this is sometimes referred to as the "Oracle snapshot".

==================================
adaptive uber info galaxies (bigger, better, faster, and more adept than cognitive innovative agile big data clouds)


 
To put it simpler, when you start a select oracle will only allow the select to see the data as it was when you started the select. Also if you are querying on the TS_FIELD then make sure that it is indexed. It will greatly speed up the select.

Bill
Lead Application Developer
New York State, USA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top