Query vs View Performance
Hello All,
I am looking for some guidance on teh performance overhead of using Queries versus Views.
If we create a "Super Query" Query_1 :
Characteristic A
Characteristic B
Characteristic X
KF C
Then a "minimal view" Query_1_View_1:
Characteristic A
KF C
Then a "minimal query" Query_2:
Characteristic A
KF C
So view Query_1_View_1 and query Query_2 deliver the same results to the end-user ......
Which will be the best performer?
Query_1_View_1 or Query_2
I am guessing that the answer will be Query_2, because the view Query_1_View_1 has to return all the Characterics of Query_1 before forming the View representation Query_1_View_1 and returning result to the end-user.
( and any aggregates that satisfy Query_2, but not Query_1, will never be invoked)
Are these assumptions correct, or is "view processing" smarter than we think?
Will Query_1_View_1 and Query_2 in fact perform the same?
All comment appreciated, thanks.
Ian Reid
Performance wise it may not be significat.
But if you the queries differe only by the characteristic values, it is better to keep them as views so that it is less query to be upgraded.
Ravi Thothadri
Similar Messages
-
Options to control display performance of CLOBs, etc. in Query Result view?
Whenever I attempt to query a table that contains LOBs (e.g. a CLOB or XMLTYPE), the lack of performance pretty much makes the "Query Result" view (from F9) unusable. Any time I attempt to scroll the results, SQL developer apparently continues to query the database for the additional characters to populate the view.
Resizing the columns containing the LOB to only a few characters almost solves the issue. Unfortunately, the size of the columns showing the LOBs apparently attempt to resize to the length of the LOB, making the column several pages long - and the same performance issue prevents resizing it smaller.
Ideally, there would be some way to resize a column to a given or even a predefined and small size, without having to drag the resize handle the entire width of the desired resize amount. Alternatively, there could be a user preference to never set default column widths above a given number of pixels or characters. Another option would be a user preference to disable the in-line display of LOB contents, displaying only and requiring a click on the "..." (or pencil icon) button to open the "View Value" dialog. Ideally, all 3 of these options could be implemented.
One crude work-around I'm using for now is to exclude the LOB columns from the results, requiring me to make secondary queries to see the LOB contents when necessary, and doesn't allow for scrolling through and viewing the LOB contents at all. Another work-around is to run the query as a script (F5) instead of a query (F9), and view the results in the "Script Output" view instead.
I'm currently using SQL Developer 2.1.0.63, but experienced this same issue with all previous versions, including 1.5.5.
Thanks!I agree.
When I requested to auto-width the columns, I said to build in a maximum, but apparently they didn't.
I suggest you log 2 feature requests on the SQL Developer Exchange; 1 for the maximum width, 1 for the CLOB contents/performance. Like this others can vote too and add weight for future implementation (I will).
Have fun,
K. -
[ADF-11.1.2] Proof of view performance tuning in oracle adf
Hello,
Take an example of : http://www.gebs.ro/blog/oracle/adf-view-object-performance-tuning-analysis/
It tells me perfectly how to tune VO to achieve performance, but how to see it working ?
For example: I Set Fetch size of 25, 'in Batch of' set to 1 or 26 I see following SQL Statement in Log
[1028] SELECT Company.COMPANY_ID, Company.CREATED_DATE, Company.CREATED_BY, Company.LAST_MODIFY_DATE, Company.LAST_MODIFY_BY, Company.NAME FROM COMPANY Companyas if it is fetching all the records from table at a time no matter what's the size of Batch. If I am seeing 50 records on UI at a time, then I would expect at least 2 SELECT statement fetching 26 records by each statement if I set Batch Size to 26... OR at least 50 SELECT statement for Batch size set to '1'.
Please tell me how to see view performance tuning working ? How one can say that setting batch size = '1' is bad for performance?Anandsagar,
why don't you just read up on http://download.oracle.com/docs/cd/E21764_01/core.1111/e10108/adf.htm#CIHHGADG
there are more factors influencing performance than just query. Btw, indexing your queries also helps to tune performance
Frank -
Parallel Query on Views or MV or snapshot?
Hi All,
I'm in oracle 10gr2 and moving to 11gr2 soon...
I have a view ( has over a million records) that is created on a view ....basically has 5 layers of views beneath...and the performance as been painfully slow.
Is it possible to have parallel select query on views or Materialized views or snapshots?
Thanks and appreciate your sugessions..
HUuser32322435 wrote:
TRUE..I agree its not the best design...but that is how the DB was handed ..and it too complicated to re-design....sorryYou don't have to be sorry about it, but you (and your users) will have to live with the ramifications of it.
Parallel query is useful in a very limited set of circumstances. Attempting to overcome a design flaw is not one of them.
I would look into materialized view if you absolutely must, but before tossing more complexity on top of existing complexity in order to cover up a design flaw .... i would go to management and explain how your application is poorly designed and needs to be redesigned if you ever expect to get a semblance of performance from your application.
NOTHING is too complicated to redesign, it just takes time and thought. -
Query to view the support group of a generated ticket in the Database, not the Data Warehouse
Hi,
I need a query to view the support group of a generated ticket, but the query must be useful in the only Database (I don't know what happened in the DW, could be a issue).
Please help me,
Greetings!it's "possible", in the same way that low temperature fusion and space elevators are "possible". There's nothing conclusively ruling it out, but not something you want to attempt on your own under a time constraint.
The "Active" ServiceManager database is a 5th or 6th normal form dynamic software defined snowflake schema representitive object database. Updating the database directly is strictly unsupported, and
Travis has discouraged people from even trying to read from it. a college of mine does service manager and operations manager databases at a 400+ level full time, and after 2+ years of doing it, he
almost understands the operational database. it's WELL beyond me, and I do Service Manager basically full time.
That being said, if you are brave and only looking for some basic data, you might be able to tease some things out with the SQL management studio and a good grasp of SQL syntax.
for a production environment, you're much better off fixing the DW. -
SQL query or view used internally by Discoverer Open Workbook from Database
Hi Experts,
I am involved in developing a web application wherein I have to display the 'All Workbooks' similiar functionality in the 'Open Workbook from Database' dialog box of Discoverer. Can anybody provide me with the background query or view that Discoverer uses to retrieve this data for workbook listing? Please let me know if my question is confusing and requires more details.
Thanks
ThomasHi,
If you just need the list of workbooks then you need to use the EUL_DOCUMENT table:
SELECT u.User_Name Owner_Name
*,Doc.Doc_Name Workbook_Name*
*,Doc.Doc_Updated_Date Last_Update_Date*
FROM Eul_Us.Eul5_Documents Doc
*,Eul_Us.Eul5_Eul_Users Own_Usr*
*,Fnd_User u*
WHERE Own_Usr.Eu_Id = Doc.Doc_Eu_Id AND
To_Char(u.User_Id(+)) = Substr(Own_Usr.Eu_Username
*,2*
*,10);*
If you want the exact same list then you need to do the above along with the sharing :
SELECT DISTINCT
case when instr(disco_docs.doc_created_by,'#')=0 then disco_docs.doc_created_by
when instr(disco_docs.doc_created_by,'#')>0 and instr(disco_docs.doc_created_by,'#',2)=0 then (select fu.user_name from fnd_user fu where fu.user_id=substr(disco_docs.doc_created_by,2,5))
else NULL
end "Workbook Owner/Creator",
disco_docs.doc_name "Workbook Name",
disco_docs.Doc_Updated_Date "Last Update Date",
case when instr(disco_users.eu_username,'#')=0 then disco_users.eu_username
when instr(disco_users.eu_username,'#')>0 and instr(disco_users.eu_username,'#',2)=0 then (select fu.user_name from fnd_user fu where fu.user_id=substr(disco_users.eu_username,2,5))
else (select resp.responsibility_name from fnd_responsibility_tl resp where resp.responsibility_id=substr(disco_users.eu_username,2,5))
end as "Shared Name / Responsibility"
FROM
eul_us.eul5_documents disco_docs,
eul_us.eul5_access_privs disco_shares,
eul_us.eul5_eul_users disco_users
WHERE
disco_docs.doc_id = disco_shares.gd_doc_id (+)
and disco_users.eu_username(+) NOT IN ('EUL5', 'PUBLIC')
AND disco_users.eu_id(+) = disco_shares.ap_eu_id;
* Change the EUL_US to your discoverer schema...
Then you will need to compare the current user with the sharing list or creator
Good luck
Tamir -
Is it possible the query in view object is dynamic?
Is it possible the query in view object is dynamic?
Generally, make the column list dynamic.
I think this is related to whether view object can be assembled at runtime based on a dynamic cursor in a procedure?
I ask this because I would like to know how we can use OA framework to simulate crosstab workbook in Discoverer?
Anybody has some clues, please advise.
Thanks.Hi Shay,
Let me tell you briefly... I am sending input as customerId,customerNumber,CustomerName to the web service, if the record is available i am getting the response and i am displaying those records on page as a table. Now when i click a row i need to populate another table with all sale orders of that customer. From webservice datacontrol i have only customer object, I dont have Sales Order Object. For this i need master detail relation. In this case how to proceed. Thats why i am thinking to create a vO and EO object for sales orders table and i want to create view link for this sales order and customers. As i don't have customer VO and EO object to create view link. -
How to build sql query for view object at run time
Hi,
I have a LOV on my form that is created from a view object.
View object is read-only and is created from a SQL query.
SQL query consists of few input parameters and table joins.
My scenario is such that if input parameters are passed, i have to join extra tables, otherwise, only one table can fetch the results I need.
Can anyone please suggest, how I can solve this? I want to build the query for view object at run time based on the values passed to input parameters.
Thanks
Srikanth AddankiAs I understand you want to change the query at run time.
If this is what you want, you can use setQuery Method then use executeQuery.
http://download.oracle.com/docs/cd/B14099_19/web.1012/b14022/oracle/jbo/server/ViewObjectImpl.html#setQuery_java_lang_String_ -
Problems in creation of workbook using Change query local view.
Hi Experts,
I have created a Multiprovider by using union of two infocubes and created a Query based on Multiprovider. I want to restrict one infocube in Change Query local view for creating new workbooks. In Query global view we drag and drop the Infocube under Filters, but in the Query local view Filter panel is in disable mode. (My requirement is to create the workbooks using change query local view only)
How can I restrict the one Infocube values in the workbooks by using Change query local view?
Thanks in advance.
Venkat.Hi Venkat Prasad
As you told that the query is on multi provider and the view is not allowing to declare/define filter value
Just drag the infoprovider info object avilable under packet dimension to rows and right click on it restrict by selecting the name of the info provider when u right click it will show you the option of restrict once u click on it,it will takes to u a pop up where you can able to see the name of info providers and you specify according to it and finally in the display of results if you dont want to to display the info provider name then just right click on the 0infoprovider object under rows go to properties then choose hide option under display.
Hope its clear a little..!
Thanks
K M R
**Assigning points is the only way of saying thanks in SDN***
>
venkata prasad wrote:
> Hi K M R,
>
> Thanks for ur quick response. Most of the Infoobjects are common for both infocubes. I didn't understand this sentense "retrict the value with the infoprovider which values you are trying to view".
> Please explian elaborately how to restrict the values speicfic to infoprovider under rows. -
Column alias error in a query of views
Hi
I was trying to workout this query
create view dept_sal as
select d.department_name,sum(e.salary)
from departments d left outer join employees e
on d.department_id= e.department_id
group by d.department_name;
and i recieved this error message .............
Error at Command Line:2 Column:25
Error report:
SQL Error: ORA-00998: must name this expression with a column alias
00998. 00000 - "must name this expression with a column alias"
*Cause:
*Action:
I tried to put an alias for sum(e.salary) function and it worked but i dont understand why it is required or is the problem somewhere else and why an alias is needed here ???
Actually the book hasnt specfied the need for an alias at this place ...so i wanted to know why am getting this error ..
create or replace view dept_sal as
select d.department_name,sum(e.salary) as d_sal
from departments d left outer join employees e
on d.department_id= e.department_id
group by d.department_name;
view DEPT_SAL created.
Also i wanted to know if i can start a thread each time i want have a problem or can i add my questions to somebody
else's thread ..
Thanks
JayshreeHi, Jayshree,
to_learn wrote:
Hi
I was trying to workout this query
create view dept_sal as
select d.department_name,sum(e.salary)
from departments d left outer join employees e
on d.department_id= e.department_id
group by d.department_name;
and i recieved this error message .............
Error at Command Line:2 Column:25
Error report:
SQL Error: ORA-00998: must name this expression with a column alias
00998. 00000 - "must name this expression with a column alias"
*Cause:
*Action:
I tried to put an alias for sum(e.salary) function and it worked but i dont understand why it is required or is the problem somewhere else and why an alias is needed here ???Every column in a table or view must have a unique name. If you don't explicitly specify a name for the output column, Oracle will try to generate one based on the input expression. If the name does not follow the normal rules for identifiers (one of which is that the name can't contain special symbols, like parentheses) then the name must be enclosed in double-quotes.
Notice that these rules are a little different from the rules about result sets. In the result set of a main query, for example, column names do not have to be unique, and a system-generated name like 'SUM(E.SALARY)" is acceptable.
Actually the book hasnt specfied the need for an alias at this place ...so i wanted to know why am getting this error ..I can't see which book you're reading. Post a quote. If the book is available on line, post a link, too.
create or replace view dept_sal as
select d.department_name,sum(e.salary) as d_sal
from departments d left outer join employees e
on d.department_id= e.department_id
group by d.department_name;
view DEPT_SAL created.That's the right way to do it.
Also i wanted to know if i can start a thread each time i want have a problem or can i add my questions to somebody
else's thread ..It's better to start your own thread. -
Viewlink between Custom VO "Cannot set user query to view"
We have an application where we have extended custom VO and EO’s to get data from flat files. It all looks fine till we create a viewlink for a LOV with two related VO’s. The viewlink VO fails we get message of the form -Cannot set user query to view "CustomVO1" because it is a destination in a view link”. Are there any methods to override in the custom VO/EO or any parameter to be added to configs. Has someone tried this out
Thanks for the update and for sharing the solution!
Regards,
Hussein -
Report Not apperaing in User's Query Report Viewer Menu
Hello There!
Continuing with below thread
Report Category not Appearing in Report Definition
When i search for a report i created, i'm(as a normal user) not able to find any report after searching.(assigned to me or to my role.)
The view PSXPRPTSRCH_VW has two tables PSXPRPTDEFN and PSXPDATASRC .Both have oprid column which is blank and the above view's first where clause is asking for oprid.
I don't understand how then all the doc./papers on internet i read, to create Report using XML Publisher says/shows the report appears in user menu(query report viewer). May be they still using PS login to show the output?
Anybody have any idea where am going wrong?
The category,datasource,Definition,query tree all set properly. Do user need any special role/permission assigned?
BTW user can see the query report viewer menu.
Regards!
Edited by: user10569054 on Sep 27, 2012 2:32 PM
Peoplesoft Version 9.00
Database Oracle 10.2Thanks for the Reply.
from the doc. you gave, this is what i found.
Home > PeopleBooks > PeopleTools 8.52: BI Publisher for PeopleSoft > Running, Locating, and Viewing BI Publisher Reports
The Query Report Viewer allows selection and online viewing of those reports that have a data source type of PeopleSoft Query. Existing Query security applies so that each user has access to run only the reports to which he or she has qualified Query access to the data source.
The PS query and the data source is created by user PS then how can a normal user will have access to that?
I'm bit confused here.
Regards! -
Problems with query in view object
I have create query form view object that is render on a jsp. The dynamic generate query leaves out "'" single quotes on string 'not assigned' which is selected from a lov.
Does anyone no how I might fix this?
Thanks.Greg:
Please provide further details. How are you creating the dynamically generated query? Could you show the original query vs. what is executed?
Thanks.
Sung -
How do I query changed view object attribute in another view object
Jdeveloper 10.1.3.4
My requirement is that I want to be able to query a view object (based on entity) on a non-key attribute where the value I am searching on may either be in the database on an existing record or, have just been recorded by updating a different view object based on the same entity (and yet to be committed).
When querying the second view object for a value just updated via a different view object, the second view object always returns no rows. I had expected the process to be :
EntityA
ViewObjectA based on EntityA
ViewObjectB based on EntityA
ViewObjectA - query row with key = 123. update attribute Y with value 456 (attribute Y in database null). Entity cache for EntityA, key 123, atttribute Y updated with value 456
ViewObjectB - query row with attribute = Y. expect record in EntityA cache just updated to be returned. Instead, nothing is returned
Here is the code I was using (where RandScheduleEdit and RandScheduleSearch are identical view objects based on entity object RandSchedule)
public static void main(String[] args) {
String amDef = "test.cache.model.AppModule";
String config = "AppModuleLocal";
ApplicationModule am = Configuration.createRootApplicationModule(amDef,config);
ViewObject rsEdit = am.findViewObject("RandScheduleEdit");
Key rsKey = new Key(new Object[]{40});
Row[] rsEditRows = rsEdit.findByKey(rsKey,1);
Row rsEditRow = rsEditRows[0];
rsEditRow.setAttribute("SId", new Number(7827));
ViewObject rsSearch = am.findViewObject("RandScheduleSearch");
rsSearch.setWhereClause("S_ID = :SId");
rsSearch.defineNamedWhereClauseParam("SId", null, null);
rsSearch.setNamedWhereClauseParam("SId",new Number(7827));
rsSearch.executeQuery();
Row rsSearchRow = rsSearch.first();
Configuration.releaseRootApplicationModule(am, true);
}Why does rsSearch not find the record S_ID = 7827 ? It seems to only be querying new records in the database and ignoring the cached record just updated ?
Any help greatly appreciated.
Cheers,
BrentrsSearch.setNamedWhereClauseParam("SId",new Number(7827));This might help:
rsSearch.setQueryMode(ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS);
rsSearch.executeQuery(); -
How to view complete date stamp in query result view in sql developer?
Hi,
In the query result, the date present in db is shown as DD-MM-YYYY format but I want to view the complete date stamp. When I view the same data in aqua data studio, I see the complete time stamp. Please let me know if I need to do some settings in Oracle SQL Developer so that complete date is shown?
How to view complete date stamp in query result view in sql developer?
Thanks in advance,
Vineet864793 wrote:
Hi,
In the query result, the date present in db is shown as DD-MM-YYYY format but I want to view the complete date stamp. When I view the same data in aqua data studio, I see the complete time stamp. Please let me know if I need to do some settings in Oracle SQL Developer so that complete date is shown?
How to view complete date stamp in query result view in sql developer?
Thanks in advance,
VineetAlternatively you can execute below
set nls_date_format='DD-MM-YYYY HH24:MI:SS';Regards,
Achyut K
Maybe you are looking for
-
Hard drive scratching noises?
I've had my mac book for about 7 months now and i haven't had any problems until now. about a week ago my macbook began to make strange scratching noises whenever i did anything that required a lot of processing power like editing a large photoshop f
-
Error in writing to directory /tmp/OraInstall2009-05-06_10-44-05AM.
Hi, Am trying to upgrade OID using 10.1.0.4 patch.How evr when am invoking the installer it is prompting the following error. Checking installer requirements... Checking operating system version: must be redhat-Red Hat Enterprise Linux AS release 4,
-
How to use add row button of a tabuler form.
Hi all, I have created a Tabuler form in my application.Could you please tell me 'How can i use the add row button of this form' as When i click the button "NOTHING HAPPENS". Thanks Regards, Neha
-
Using JSF in High Available Applications
Hi I have a client that requires that all their applications are HA. For this I need to deploy my web applications in multiple servers and enable web session replication between those servers. I'm concerned that using JSF will require a lot of sessio
-
Downloaded Movies suddenly not working. Appear to be running but screen blank. Music works OK