Does sub program reduces the performance
hi all,
suppose that i have two solutions to increase the salaries of the employees for a table
method 1:
create or replace function inc_sal (pempno emp.empno%type) return integer
is
vsal emp.sal%type;
begin
select sal into vsal from emp where empno=pempno;
vsal:=vsal+vsal*0.30;
return(vsal);
end;
sql> select sal, inc_sal(empno) from emp;
and
method 2:
sql> select sal, sal*0.30 as inc_sal from emp;
now in the first method, for each record of the table the function is called and collect the returned value...
but for the second method there is nothing like that
so now which method is faster in performance, does the number of function calls in first method reduce the performance......?
thanks and regards,
sri ram.
Oracle has a separate SQL and PL/SQL engine. When you go from one to the other, this is called a 'context switch'.
A context switch is a costly operation.
In variant 1 you seem to embed the function you wrote in SQL.
This means
- for each record you will have a context switch
- in the function you call SQL: another context switch
- The SQL in your function will show as recursive SQL and will never get merged into the main query.
So actually variant 1 is a textbook example of 'slow by slow programming' or 'How to write unscalable applications'
Remember Tom Kytes mantra:
When you can do it in SQL, you should do it in SQL
When you can't do it in SQL, you should do it in PL/SQL
When you can't do it in PL/SQL, you should do it in Java (in the database)
When you can't do it in Java, you should do it in any language outside the database.
Sybrand Bakker
Senior Oracle DBA
Similar Messages
-
Unit Of Order reducing the performance after some threshold limit
Hi,
Our application is doing netting of trades.
We are using UOO for posing messages to JMS queues appended to it.
From this message, we are extracting the trade info and persisting into DB.
When MDB is listening to that JMS queue, application is performing well when the no. of messages in the queue is <5000.
when this number increases lets say 20000, our application is performing very badly.
We are using 64 instances of MDB connecting to queue.
What are the parameters reduce the performance of the MDB consuming the messages?
Can you please help me on this?
Thanks,
RavikumarAn increasing backlog is a sign that your MDBs are not keeping up with your senders.
See:
Tuning WebLogic JMS
http://docs.oracle.com/cd/E17904_01/web.1111/e13814/jmstuning.htm#PERFM294
and
Tuning Message-Driven Beans
http://docs.oracle.com/cd/E17904_01/web.1111/e13814/mdbtuning.htm#PERFM271 -
I am a songwriter and want to upload my work to itune but I need a few question cleared up.
1. Does Itune interact with the Performing Arts organization such as BMI in order for artist to be paid or do i just set up a paypal account and pay artist myself?
2. What percentage of sales does itune take or is it a flat rate?
3. When i upload does itune give me an option to set price for my work.?TownSquareTheMusic wrote:
I am a songwriter and want to upload my work to itune but I need a few question cleared up.
1. Does Itune interact with the Performing Arts organization such as BMI in order for artist to be paid or do i just set up a paypal account and pay artist myself?
2. What percentage of sales does itune take or is it a flat rate?
3. When i upload does itune give me an option to set price for my work.?
Town Square,
In addition to the iTunes Store, you may wish to check out some of the online stores that may be a bit more flexible for artists just starting to sell online:
NoiseTrade
BandCamp -
Will Materialized view log reduces the performance of DML statements on the master table
Hi all,
I need to refresh a on demand fast refresh Materialized view in Oracle 11GR2. For this purpose I created a Materialized view log on the table (Non partitioned) in which records will be inserted @ rate of 5000/day as follows.
CREATE MATERIALIZED VIEW LOG ON NOTES NOLOGGING WITH PRIMARY KEY INCLUDING NEW VALUES;
This table already has 20L records and adding this Mview log will reduce the DML performance on the table ?
Please guide me on this.Having the base table maintain a materialised view log will have an impact on the speed of DML statements - they are doing extra work, which will take extra time. A more sensible question would be to ask whether it will have a significant impact, to which the answer is almost certainly "no".
5000 records inserted a day is nothing. Adding a view log to the heap really shouldn't cause any trouble at all - but ultimately only your own testing can establish that. -
Does de-authorising reduce the authorisation count?
I have heard rumour that de-authorising previously authorised PC/devices doesn't actually reduce the activation count for ADE.
I this true?
I got a bit carried away when I 1st started and authorised 3 PCs at home and my bebook reader. My bebook reader had to be returned due to fault - unfortunately I didn't de-authorise it before it - adobe support tells me that there's nothing I can do about that (so that's one activation gone) and when the replacement reader turns up another activation will be used - that will be five in total - so if de-authorising does nothing to the count I'm left with one authorisation till the end of time - I've asked suppoort about this and haven't had an answer - I'm a little wary of buying more ADE books if the authorisations run out (due to pc failure or reader failure or uprades of either) and being stuck with a library I can't access.
I've checked around the forums and it looks like exceeding the authorisation count is not an uncommon problem and there appears little progress on fixing the problem on Adobe's part.
I am still waiting for a reply to the last post.
Following is my discussion with support -
Ok I understand that I can't de-activate the reader now it has been returned but assuming I keep using digital editions for years to
come, as PCs die or need the hard-drive replaced/reformated and the breakdown usually occurs without warning (ie I don't get the ch
ance to de-activate the PC) won't I eventually run out of activations? (I've already lost one to the returned ebook, one on the PC I
download with and one to the new reader when it arrives)
Under those circumstances do I have to then create a new accounbt and lose access to all my previously purchased ebooks?
I would have thought the record of authorisations would be held by adobe and therefore able to be removed/reset by adobe.
I'm just trying to understand the authorisation process before I invest too much in digital edition ebooks.
The number of authorisations is something else I'm little confused about I read in one place that I could have 6 PCs AND 5 ebooks de
vices but I think I reade on the adbode site that it is only 5 PCs or devices in total.
Thanks for your assistance with these queries
Notes to Customer
Thursday, May 20, 2010 6:44:21 PM PDT
Hi Catherine,
Thank you for getting back to us. I appreciate your promptness in
responding to our email.
The information provided was really helpful in understanding the issue.
As per the latest update provided by you my understanding is that you
have returned your E-reader to your vendor for replacement.
Catherine , I would like to inform you that in this case you are not
able to de-activate your E-reader because it must be connected to the
computer.
However you can de-authorize your remaining computers by simple process
advised in last interaction.
You can also try referring to our knowledge base and User to User forums
by clicking on the following links:
Knowledge base: http://www.adobe.com/cfusion/search/index.cfm
U2U Forums: www.forums.adobe.com authorization
To know more about Adobe products, please visit our product page:
www.adobe.com/products
Thanks for contacting Adobe Technical Web Support and we appreciate your
time spent.
Have a nice day.
Regards,
Abhishek maheshwari,
Adobe Technical Support
Notes from Customer
Thursday, May 20, 2010 6:02:47 AM PDT
Hi,
Thank you for the response, I haven't had time to check my email until today. Unfortunately I had already returned the ebook to the
seller for warranty replacement when I sent my query, so I can't connect it to my computer to deactivate it's subscription. Is the
re another way of deactivating the ebook from my authorisations list without having the device physically present?
regards,
Catherine Taylor
Notes to Customer
Monday, May 17, 2010 11:54:57 AM PDT
Hi Catherine,
Thank you for contacting Adobe Technical Support. My Name is Abhishek.
This is in regards to your query posted on the Adobe web support portal
regarding an issue with Adobe Digital Editions.
At the outset please accept our gratitude for choosing Adobe.
Based on the information provided by you, my understanding of your issue
is that you want to deactivate your faulty E-reader and Digital Editions
from your unused computers.
Catherine , I would like to inform you that you do not need to
De-authorize Digital Editions completely from every device you use, just
follow the below steps to De-activate extra subscriptions from your
unused computers and E-reader.
1. To deactivate E-reader>
a. Connect your E-reader with computer .
b. Launch E-reader and press Ctrl+ Shift+E to deactivate it.
2. To deactivate Digital Editions from computers>
a. Launch Adobe Digital Editions on the computer you want to
deactivate .
b. Press Ctrl+ Shift+ D to deactivate it.
I believe,This will resolve your query .
In future, if you face any problems with Adobe Products., You could try
referring to our knowledge base and User to User forums by clicking on
the following links:
Knowledge Base: http://www.adobe.com/cfusion/search/index.cfm
U2U Forums: www.forums.adobe.com
You can visit our product page at: www.adobe.com/products
Your technical support case number for this interaction is: 181592641
Have a nice day.
PLEASE NOTE: Dear Customer, we will be waiting for your reply on this
case. In case you are unable to respond we will be sending you a
reminder on the 2nd day (From the day of our response to you) and then
the case will be auto closed on 7th day assuming your issue is resolved.
However, you can reopen your case by visiting our web support portal
and we will be happy to assist you further.
Regards,
Abhishek Maheshwari,
Adobe Technical Support
Notes from Customer
Monday, May 17, 2010 3:22:56 AM PDT
Hi, I'm new to digital editions and I tried installing and authorizing three PCs and one ebook reader while learning how to use digi
tal editions (got a bit carried away).
My ebook reader has a fault and I'm returning it and expect to recieve a new unit soon. My question is how do I go about deactivatin
g the ebook reader prior to return and can I deactivate the PCs so I can authorize only the PCs I need. I assume without deactivatin
g something I will run out of activations at some point.
I suppose if I could de-authorize everything and start again that would be great - assuming I don't lose the rights to the books I h
ave already purchased.>I have heard rumour that de-authorising previously authorised PC/devices doesn't actually reduce the activation count for ADE.
>I this true?
Yes, you only want to deauthorize when getting rid of a machine (as a step remove your personal information), or when directed to by a competent tech support person.
If you run out of activations you will need to contact tech support by going to http://www.adobe.com/support/digitaleditions and clicking on 'Submit a web case' -
In which cases does String.intern() increase the performance?
I'm optimizing my program and I wonder when I should use the String.intern() method to increase my performance. Is there a downside of using the intern() method?
paul.miner wrote:
kajbj wrote:
I have once implemented a system where intern was called on all strings when they arrived from a socket, and all comparisons was done using == after that. The reason was actually performance since we had to compare lots and lots of strings often. There is however a drawback with it. calling intern() when you have many strings in the pool is very slow (I would guess that it was linear time). You it's now always that you can improve performance by calling intern and comparing with ==Good point.
I think if I was in this position though, I'd create my own interned string pool instead of cluttering the one in String.We tried that as well. We pretty much did everything we could think of to reduce memory footprint while gaining execution time. Startup time was not of importance so it was not a problem that it took an hour to start the system. -
How to avoid the loop inside the loop? as it reduces the performance.
hi masters,
i have 2 internal tables having 1 same field. eg table itab having f1, f2, f3 fields and itab1 having f1, f4 and f5 fields. let us consider the data in the itab and itab1 is like below given
itab-f1 itab-f2 itab-f3 itab1-f1 itab1-f4 itab1-f5
10 aa 11 10 abc 456
10 bb 15 10 def 655
10 ff 13 10 ghi 456
11 dd 16 10 tre 455
11 zz 24 11 ftr 256
11 ii 54 11 kjh 556
12 hh 24 12 fjk 751
now i want the result in final table like below
f1 f2 f3 f4 f5
10 aa 11 abc 456
10 aa 11 def 655
10 aa 11 ghi 456
10 aa 11 tre 455
10 bb 15 abc 456
10 bb 15 def 655
10 bb 15 ghi 456
10 bb 15 tre 455
10 ff 13 abc 456
10 ff 13 def 655
10 ff 13 ghi 456
10 ff 13 tre 455
11 dd 16 ftr 256
11 dd 16 kjh 556
11 zz 24 ftr 256
11 zz 24 kjh 556
11 ii 54 ftr 256
11 ii 54 kjh 556
12 hh 24 fjk 751
i can get this result using the
Loop at itab.
loop at itab1 where f1 = itab-f1.
process....
endloop.
endloop.
but it is very slow. i want to avoid this loop inside the loop and i want to implement the same program using read table.. like below..
Loop at itab.
Read table itab1 with key ....
process...
endloop.
Is it possible? to get multiple records from itab2 using read statement or with READ statement that using CASE Statement or IF statemetnt.
Plz help me...hi,
please try the following code
TYPES:
begin of ty_itab2,
f1
f2
f3
f4
f5
end of ty_itab2.
DATA:
lw_tab2tmp type ty_itab2,
lt_tab2tmp type standard table of ty_itab2.
sort it_itab by f1.
loop at it_itab into lw_itab.
at new f1.
CLEAR lt_tab2tmp[].
loop at it_itab1 into lw_itab1 where f1 = lw_itab-f1.
CLEAR lw_tab2tmp.
move-corresponding lw_itab1 to lw_tab2tmp.
append lw_tab2tmp into lt_tab2tmp.
end loop.
"while there is no data with f1 in it_itab1
if lt_tab2tmp is initial.
lw_tab2tmp-f1 = lw_itab-f1.
append lw_tab2tmp into lt_tab2tmp.
endif.
end at.
CLEAR lw_tab2tmp.
MOVE-CORRESPONDING lw_itab to lw_tab2tmp.
modify lt_tab2tmp from lw_tab2tmp TRANSPORTING f2 f3 where not f1 is initial.
append lines of lt_tab2tmp into lt_itab2.
end loop.
lt_itab2 is the final table.
There may be some syntactically errors.
I have not a system to test it now, please test it. -
Does Audit Trail degrade the performance on 11g ?
Oracle 11g DB actually turns on standard audit trail function via DBCA.
Could anybody know how the negative impact for this function is ?
Is there any reference (Almost 5% perfermance impact )?
Thx so much.Watami, reading your post reminded me that 11g comes with a set of default privileges automatically set up for auditing. Since the privileges are pretty much DDL and you should not be performing very much DDL on a production database I would think the overhead would be almost too low to measure.
For those unware of this feature change or who have forgotten like me here are the default audit privileges:
Oracle Database audits the following privileges by default:
ALTER ANY PROCEDURE CREATE ANY LIBRARY DROP ANY TABLE
ALTER ANY TABLE CREATE ANY PROCEDURE DROP PROFILE
ALTER DATABASE CREATE ANY TABLE DROP USER
ALTER PROFILE CREATE EXTERNAL JOB EXEMPT ACCESS POLICY
ALTER SYSTEM CREATE PUBLIC DATABASE LINK GRANT ANY OBJECT PRIVILEGE
ALTER USER CREATE SESSION GRANT ANY PRIVILEGE
AUDIT SYSTEM CREATE USER GRANT ANY ROLE
CREATE ANY JOB DROP ANY PROCEDURE
Oracle Database audits the following SQL shortcuts by default:
ROLE SYSTEM AUDIT PUBLIC SYNONYM
DATABASE LINK PROFILE SYSTEM GRANT HTH -- Mark D Powell --
edit paste had lost col alignment, try to add back
Edited by: Mark D Powell on Feb 11, 2010 7:59 AM -
Does triggers effect the performance
Hi all,
I have 3 triggers on the table....2 of which are select triggers and one is it insert into other tables whenver there insert/update/delete for each row..
so if i do dataload say 1 lac rows on the table which has trigger.
does trigger slows down the performance.
thanksuser11278505 wrote:
Hi all,
I have 3 triggers on the table....2 of which are select triggers and one is it insert into other tables whenver there insert/update/delete for each row..
so if i do dataload say 1 lac rows on the table which has trigger.
does trigger slows down the performance.As compared to what?
If the trigger is properly written, and if the action that the trigger is to perform would have been performed anyway by the application but at the application level, then perhaps a trigger could be faster.
If the trigger is doing stuff that should have been done elsewhere (eg: instead of declarative constraints) then a trigger could be slower.
If the trigger is doing stuff on a per-row basis that could be done better on a per-set basis, especially when handling bulk data (which is the specialty of an RDBMS, much to many developer's surprise), then realize we often turn off constraints for exactly that reason during bulk loads.
If the trigger is doing stuff that it shouldn't be doing at all, well ... I let you figure that one out.
In the mean time, I have no idea of the context of the question and therefore the answer - like so often in Oracle - is 'it depends'. -
What is advantage of doing Extended Program Check ?
What is the advantage of doing extended program check?
With Best Regards
MamathaHi mamatha,
EPC, advantages are.........
With the help of EPC we can find out the
1. Absolete stmts
2. Authorization checks
3. Problematic stmts
4. Any hidden messages
through this we can increase the consistency of the program and the performance can also be increased.
And we can find out the stms that causes the problems in future when modifications are happened.
For this go to <b>se38</b> then <b>program</b> then <b>check</b> then <b>EPC</b>
Thanks,
Venkat Chaiatnya -
Need to improve the performance
Hi,
New fields are added in the standard table,Before the we used select single * from the table in program,Now because of those fields it reduced the performance,How to improve the performance of the select queary.
Thanks in advanceHi
folow these rules
When a base table has multiple indices, the where clause should be in the order of the index, either a primary or a secondary index.
To choose an index, the optimizer checks the field names specified in the where clause and then uses an index that has the same order of the fields . In certain scenarios, it is advisable to check whether a new index can speed up the performance of a program. This will come handy in programs that access data from the finance tables.
For testing existence , use Select.. Up to 1 rows statement instead of a Select-Endselect-loop with an Exit.
SELECT * FROM SBOOK INTO SBOOK_WA
UP TO 1 ROWS
WHERE CARRID = 'LH'.
ENDSELECT.
The above code is more optimized as compared to the code mentioned below for testing existence of a record.
SELECT * FROM SBOOK INTO SBOOK_WA
WHERE CARRID = 'LH'.
EXIT.
ENDSELECT.
Use Select Single if all primary key fields are supplied in the Where condition .
If all primary key fields are supplied in the Where condition you can even use Select Single. Select Single requires one communication with the database system, whereas Select-Endselect needs two.
<b>Reward if usefull</b> -
How to reduce the number of DB calls in Biztalk Map
Hi,
I am using the
1. first scripting Functoid(calling External Assembly) to fetch the details from DB as comma separated values(1,2,3)
2. Scripting Functoid to apply Inline XSLT temple(which will pick the comma separated value and place it as three different records)
Instance messages
All the items are working as expected but, the call to DB is happening for each record in the details.
if my input has n number of details section, the database call is happening n times, which is drastically reducing the performance.
I wanted to make it as one DB call . Please suggest
Regards, Vignesh SHi,
You can also use the Blogical BizTalk Database lookup functoid with caching feature.This functoid can be used like the
Database lookup functoid that ships with BizTalk. It will execute a query against a given database and cache the result using the
System.Web.Caching.Cache with a sliding expiration of one minute.
Download:
https://blogicalfunctoids.codeplex.com/
Kind regards,
Tomasso Groenendijk
Blog
| Twitter
MCTS BizTalk Server 2006, 2010
If this answers your question please mark it accordingly -
Making sub-programs with picture objects
Hello all,
I'm a mentor for a FRC Robotics Team. For the summer, I want to try to make a VI that is able to create sub-programs for the autonomous period. Basically, there would be this canvas that the user could move the "robot" (aka rectangle) around, and it would record its movements and "translate" them into "motor code".
For instance: I want my robot to go straight for about 3 feet, rotate 90 degrees clockwise, and go another 3 feet. I would take the rectangle, drag it up an equivalent 3 feet (maybe using a grid pattern to show 0.5 feet increments), rotate the rectangle 90 degrees clockwise, then drag it another 3 feet.
This is the big picture. Right now, I want to know if it's possible to have a user drag a picture (such as a rectangle) and have the program where it is on a coordinate plane.
Thanks!Whenever I hear someone ask, "Can LabVIEW..." I always say yes, regardless of what comes next. In the the case of your requirement, there is (or at least was) an example in one of the lower-level training classes that did most is what you want.
The point of the exercise was to teach saving binary data, but to generate the data (this is the bit that will be interesting to you) they created a little drawing program using mouse events on a 2D picture control.
So, yes, what you want to do is very doable, my sense though is that it is one of those projects that would take a couple hours to create a working prototype, but you could play with tweaking for months...
Have fun!
Mike...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps -
I want to write a java program that can add a user to a role or sub role to the Profile Database in iPlanet Portal Server 3.0. Does anyone has any idea or a sample program do such thing? Thanks, Tommy
// create the user profile, get the handle back,
// and set the membership profile attributes.
ProfileAdmin newProfile = null;
try {
// the users profile name is the domain
// he belongs to plus their userName
// you will request.domain if your doing this from a servlet, domain_name is the domain_name the user belongs too
String profileName = domain_name + "/" + user;
if (debug.messageEnabled()) {
debug.message("creating profile for " + profileName);
// create the user profile object
newProfile = ProfileManager.createProfile(
getSession(), profileName ,Profile.USER);
UserProfile userProfile = (UserProfile)newProfile;
// set the role the user is a member of. Default is to set
// the users to the default role of the domain they surfed to
StringBuffer roleName = new StringBuffer(64);
// request.domain instead of domain_name if your doing this from a servlet ..
Profile dp = getDomainProfile(domain_name);
roleName.append(dp.getAttributeString("iwtAuth-defaultRole"));
if (debug.messageEnabled()) {
debug.message("setting role for " + user + " = " + roleName);
userProfile.setRole(roleName.toString());
newProfile.store(false);
} catch (ProfileException pe) {
debug.error("profile exception occured: ",pe);
return;
} catch (ProfileException pe) {
debug.error("login exception occured: ",le);
return;
HTH .. -
No Data when doing multiple selection of sub-brand in the cube
Hey everyone.
I am having a very strange situation.
No Data when doing multiple selection cube.
The thing is that the situation is created only in the transition between the servers, who have a different Build but both of them are SQL 2008R2 servers.
The Build of one of them is 10.50.2789.0 and the other one is 10.50.4000.0 (SP2).
The other properties of the cube are the same, it's Not possible to retrieve data from the cube on the server with the "SP2 when we the slicing is at the level of sub-brand and removed even one item mean we passed a multiple selection ,
This is possible only if we connect the cube as Admin .
While the server with the older "Build" the problem to perform the above operation when connected as a user not exist.
What can cause this problem,and how can we fix it?
thank's a lot.Hi Doron2Bull,
According to your description, there are two servers in your scenario, and you cannot retrieve data from one of the cube, right? Are there any differences between the two cubes on different? You can import the database on the server into BIDS and explore
Data on the fact table on the Data Source View to check if there are any data. If we can see the data when we do Explore Data on the fact table on the Data Source View (DSV), but when we browse the cube here is no data. Then there are many possibilities for
this issue.
On the cube's Dimension Usage, the relationship between this measure group and the dimension is not correctly defined.
On the relational database, the dimensional key column on the fact table does not correspond to the key column on dimension table.
There is a Default Member on another dimension, and there is no fact table row that satisfy this condition.
If I have anything misunderstood, please point it out.
Regards,
Charlie Liao
TechNet Community Support
Maybe you are looking for
-
Help! Can't transfer music to iPod Mini!
Hi there! I had some CDs that went with my iPod mini that I do not have with me right now for installation when I wanted to set my iPod up with my computer. So instead of using the CDs, I downloaded iTunes from http://www.apple.com/itunes/download/ .
-
ITunes tells me my iPad is synced to a different library. It's not.
We bought a new iPad Air and immediately synced it to our iTunes library, hand choosing 3000 songs. I went back later to add some books, and iTunes tells me that the device is synced to a different library (it's not, same library) and that to sync bo
-
Links in blog summary don't work
Hi, Ever since I upgraded to iLife '08 any links that I post in my blog page don't work in the summary (or RSS feed). For some reason when iWeb creates the summary it changes the links. For instance a web gallery link may end in gallery#10005 and the
-
My email icon won't launch Mac OS 10.9.4
Hello, I had this weird problem - my email won't launch, and It did last night. Any ideas ?
-
Macbook Air Problem (bought in 2012)
Has anyone had beeping noises, followed by their macbook air shutting down while continuing to beep?