Home » SQL & PL/SQL » SQL & PL/SQL » Does The Query get Fired Again
Does The Query get Fired Again [message #277049] Sun, 28 October 2007 04:07 Go to next message
abhi123
Messages: 1
Registered: October 2007
Location: mumbai
Junior Member

Does the query get fired again when i query a existing view

1. create view abc as select name from Table

2. select name from abc

Table is a really large table wid many columns and many rows

Lookin for a better performance coz i need names in one procedure and again need the same names for deletion in another procedure

I dont want to fire the same query twice dats y.
Re: Does The Query get Fired Again [message #277050 is a reply to message #277049] Sun, 28 October 2007 04:11 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Yes it fires each time you execute the query.
A view is nothing more than a stored query text and not query result.

Regards
Michel
Re: Does The Query get Fired Again [message #277053 is a reply to message #277049] Sun, 28 October 2007 04:21 Go to previous messageGo to next message
Arju
Messages: 1554
Registered: June 2007
Location: Dhaka,Bangladesh. Mobile:...
Senior Member

Quote:

I dont want to fire the same query twice dats y.

what is this?
Re: Does The Query get Fired Again [message #277054 is a reply to message #277053] Sun, 28 October 2007 04:24 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
I think firing means execution.

By
Vamsi
Re: Does The Query get Fired Again [message #277055 is a reply to message #277054] Sun, 28 October 2007 04:39 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Yes, I read it like this but maybe I misread it.

Regards
Michel
Re: Does The Query get Fired Again [message #277057 is a reply to message #277049] Sun, 28 October 2007 04:57 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Please read and follow OraFAQ Forum Guide, especially section about IM speak.

Regards
Michel
Re: Does The Query get Fired Again [message #277058 is a reply to message #277049] Sun, 28 October 2007 05:03 Go to previous messageGo to next message
Arju
Messages: 1554
Registered: June 2007
Location: Dhaka,Bangladesh. Mobile:...
Senior Member

Now I understood. dats which I could not able to figure out immediately. It will be thats.
Re: Does The Query get Fired Again [message #277077 is a reply to message #277049] Sun, 28 October 2007 09:57 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
It is the other way around from what you think:
When you create the view, the query itself is not executed. Only when querying the view it will be executed.
Re: Does The Query get Fired Again [message #277265 is a reply to message #277077] Mon, 29 October 2007 06:12 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
If you want to execute a query once, and have a queriable set of data as a result, you need to look at Materialized Views
If your query is as simple as the one you posted, then you should be able to create a MV that will reflect changes to your data in real time (look up the phrases 'FAST REFRESH' and 'ON COMMIT' in the MV documentation), otherwise you will need to schedule refreshes to the data.
Previous Topic: New line while assigning value to a variable
Next Topic: Translate Number value to Character
Goto Forum:
  


Current Time: Tue Dec 03 21:00:23 CST 2024