Home » SQL & PL/SQL » SQL & PL/SQL » Select query is hitting the database multiple times
Select query is hitting the database multiple times [message #635492] Tue, 31 March 2015 01:23 Go to next message
kiran_vangeti
Messages: 2
Registered: March 2015
Location: Hyderabad
Junior Member
My Application is hitting the same select query multiple times for example per second 15 times. some times it is giving results in 2 to 3 seconds some times it is taking 10 to 15 seconds, is there any way to retrieve the data in 2 to 3 seconds.

Using Oracle 12C
Re: Select query is hitting the database multiple times [message #635493 is a reply to message #635492] Tue, 31 March 2015 01:26 Go to previous messageGo to next message
John Watson
Messages: 9003
Registered: January 2010
Location: Global Village
Senior Member
If you have Enterprise Edition licences, you could use a Result Cache.
Re: Select query is hitting the database multiple times [message #635496 is a reply to message #635493] Tue, 31 March 2015 01:46 Go to previous messageGo to next message
vippysharma
Messages: 73
Registered: May 2013
Location: www
Member
Use explain Plan to trace the reason.
Re: Select query is hitting the database multiple times [message #635497 is a reply to message #635492] Tue, 31 March 2015 01:49 Go to previous messageGo to next message
Michel Cadot
Messages: 68776
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator

Which query?
Why is it execute 15 times per second?
What does it return?

Re: Select query is hitting the database multiple times [message #635509 is a reply to message #635497] Tue, 31 March 2015 05:36 Go to previous messageGo to next message
kiran_vangeti
Messages: 2
Registered: March 2015
Location: Hyderabad
Junior Member
It is a simple select statement to retrieve the user information from database, target here is need to send the sms messages and emails in only 10 seconds latency, and for every second OSB (Oracle Service Bus) is hitting 15 messages to the database, this is the requirement for me. So that every time the same query is executing for the different transaction id's. For some transaction id's it is executing in 2 to 3 seconds only but for some it is taking 10 seconds. Verified explain plan, but the query cost showing is 14
Re: Select query is hitting the database multiple times [message #635510 is a reply to message #635509] Tue, 31 March 2015 05:39 Go to previous messageGo to next message
John Watson
Messages: 9003
Registered: January 2010
Location: Global Village
Senior Member
You need to provide some information. For example:

What is the query? What is the execution plan? What are the execution statistics?
All the above for when it is fast and when it is slow.
Re: Select query is hitting the database multiple times [message #635512 is a reply to message #635509] Tue, 31 March 2015 05:43 Go to previous message
Michel Cadot
Messages: 68776
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator

In addition, if it is static user information you don't need to query them 15 times per second.
Please answer ALL the questions we post you, you don't need to repeat what you have already said or to answer to questions we did not ask for the moment.
This is the requirement for you here. Smile

Previous Topic: case
Next Topic: JSON parsing?
Goto Forum:
  


Current Time: Wed Aug 26 06:39:42 CDT 2026