Why the content of the Explain Plan not show out?
Why the content of the Explain Plan not show out?
I am using Oracle 11g.
I already ran the utlxplan.sql sctipt and I also set serveroutput on.
SQL> set autotrace on
SQL> EXPLAIN PLAN FOR SELECT*FROM DEMO_TABLE WHERE OWNER='HR';
Explained.
Elapsed: 00:00:00.67
When you say:
My release 10.2 database display the Explain Plan automatically.
How to make 11.1.0.6 Oracle database to display the Explain Plan automatically.What do you mean? Specifically, what commands are you executing in the 10.2 database, that displays the execution plan "automatically"?
Are you saying that if you execute the same command in 11.1.0.6, you don't get a similar result? What happens? Do you get an error?
For both the 10.2 case and the 11.1.0.6 case, post the full output of the commands you're executing, and the result you are seeing.
Then, maybe someone can help you.
When you post the output, please encapsulate it in a pair "code" tags, which is the word "code" without the quotes, surrounded by a pair of curly braces {}.
When you do this correctly, the output looks like:
This is output from my execution plan run.and is much easier to read.
Don't be afraid to use the preview tab to see if your message will be posted with the correct formatting.
-Mark
Similar Messages
-
Why the iPhone dose not show the witting in case if the other person have a call and I'm on witting? really I'm dissappointed with this point Why we do not have this service?
That is not a feature of the iPhone (or of any phone I've ever had so apparently it's far from universal). Apple has not said why they have no such feature.
You can request such a feature here:
http://www.apple.com/feedback
Either the person you're calling will answer you or they won't. What difference does it make why? -
Do anyone know why the desktops do not show? Is this a bug?
Do anyone know why the desktops do not show?
See:
* http://kb.mozillazine.org/Images_or_animations_do_not_load
Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
* Don't make any changes on the Safe mode start window.
See:
* [[Troubleshooting extensions and themes]] -
Why the explain plan incorrent?
I have a sql in oracle10.2.03:
select *
from (select a.*
from t_user a, t_message b
where b.user_id = a.row_id and a.user_type = 1
order by b.happen_time desc)
where rownum <= 5
there are indexes on column a.user_type,b.user_id,b.happen_time, and has been analyzed. a.user_type=1 only have 1/1000 records
the explain plan is below:
cost Cardinary Bytes
SELECT STATEMENT, GOAL = ALL_ROWS 30 5 3790
COUNT STOPKEY
VIEW BMTEST 30 6 4548
NESTED LOOPS 30 6 1158
TABLE ACCESS BY INDEX ROWID BMTEST T_MESSAGE 13 1524118 24385888
INDEX FULL SCAN DESCENDING BMTEST IDX_MESSAGE_2 1 168
TABLE ACCESS BY INDEX ROWID BMTEST T_USER 1 1 177
INDEX UNIQUE SCAN BMTEST PK_USER 1 1
Oracle use the index full scan descending on the happen_time. the cost only has 30.
After I add hint on the sql on the user_id of t_message
select *
from (select /*+index (b idx_message_1)*/ a.*
from t_user a, t_message b
where b.user_id = a.row_id and a.user_type = 1
order by b.happen_time desc)
where rownum <= 5
the explain plan change to:
cost Cardinary Bytes
SELECT STATEMENT, GOAL = ALL_ROWS 5020 5 3790
COUNT STOPKEY
VIEW BMTEST 5020 54707 41467906
SORT ORDER BY STOPKEY 5020 54707 10558451
TABLE ACCESS BY INDEX ROWID BMTEST T_MESSAGE 26 515 8240
NESTED LOOPS 2707 54707 10558451
TABLE ACCESS BY INDEX ROWID BMTEST T_USER 1 106 18762
INDEX RANGE SCAN BMTEST IDX_USER_2 1 106
INDEX RANGE SCAN BMTEST IDX_MESSAGE_1 1 515
INDEX UNIQUE SCAN BMTEST PK_USER 1 1
The cost is 5020, but the execute usage time only is 100ms, and the first SQL does not add hint usage 20s.
Why the lower cost waste more time, if the cost caculate is incorrect?
Edited by: [email protected] on Sep 11, 2008 9:14 PM[email protected] wrote:
But i am afraid i use a misunderstand title for this post,my doubt is why oracle get a large cost with the sql execute few time but get a small cost with the sql execute long time.The cost of a query isn't a particularly good proxy for runtime. It is perfectly reasonable for a query with a cost of 1000 to run more quickly than a query with a cost of 100. The cost of queries is only directly comparable between different plans in the same 10053 trace file.
[email protected] wrote:
All the indexed columns are both analyzed by the command or by DBMS_STATS package and the cpu costing is enabled.But what order are the commands being run? And why is the ANALYZE command being used to gather optimizer stats.
In the first plan:
INDEX FULL SCAN DESCENDING BMTEST IDX_MESSAGE_2 1 168
Why this index full scan cost only 1? how did oracle get this number? Is there formula to caculate the cost of index full scan? I have read the article named "Cost Based Oracle Fundamentals" and there is no introduce how to caculate it.
I think this abnormality cost makes the cost of next step "NESTED LOOPS" very smal and finally lead this abnormality result.1) Which article are you talking about? Are you talking about Jonathan Lewis's book "Cost Based Oracle Fundamentals"? Or are you referring to a different article somewhere?
2) Can you post the query plans formatted via DBMS_XPLAN.DISPLAY (including the predicate information and enclose the output in the \[pre\] and \[pre\] tags to preserve white space?
Justin
Justin -
Why the Itune is not showing my iphone in it???
I m using Iphone 5s and i want to copy songs and some other stuff from my pc to my iphone. I searched for it on google and read some discussion on the official site of APPLE, acc. to them i need Itune to do so. I downloaded it from the apple site but when i connect my Iphone to my pc then The Itune does not show my IPhone anywhere... plz help
Hey nrathi,
Thanks for using Apple Support Communities.
Follow this article since the iPhone does not appear under Devices in iTunes.
iOS: Device not recognized in iTunes for Windows
http://support.apple.com/kb/ts1538
Have a nice day,
Mario -
Explain Plan not showing correct results.
Hi Gurus,
Please help me to understand below issue.
Whenever I am doing explain plan on any of the sql statements it says as explained but when retriving the explain plan output it shows same results again and again.
DB - 11gR2 Stand alone
ASM - Configured.
OS - RHEL 6.2.
SQL> select count(*) from t2114;
COUNT(*)
639292
SQL> explain plan for select count(*) from t2114;
Explained.
SQL> @?/rdbms/admin/utlxpls.sql
PLAN_TABLE_OUTPUT
Plan hash value: 1497650422
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 6634 | 524K| 2993 (19)| 00:00:01 |
| 1 | SORT ORDER BY | | 6634 | 524K| 2993 (19)| 00:00:01 |
| 2 | TABLE ACCESS BY INDEX ROWID| T2210 | 6634 | 524K| 2947 (17)| 00:00:01 |
|* 3 | INDEX RANGE SCAN | T2210_T | 6842 | | 108 (22)| 00:00:01 |
Predicate Information (identified by operation id):
3 - access("T2210"."C490008000"=:SYS_B_0 AND "T2210"."C490009100"=:SYS_B_2
AND "T2210"."C301363300"=TO_NUMBER(:SYS_B_1))
16 rows selected.
SQL> explain plan for
2 SELECT T2114.C1 FROM T2114 WHERE ((T2114.C1000000001 = :"SYS_B_0") AND (T2114.C536871442 = :"SYS_B_1") AND (T2114.C536871477 = :"SYS_B_2") AND ((:"SYS_B_3" - T2114.C3) >= :"SYS_B_4") AND ((:"SYS_B_5" - T2114.C3) <= :"SYS_B_6") AND (T2114.C1000000217 LIKE :"SYS_B_7") AND (T2114.C536871478 < :"SYS_B_8")) ORDER BY C1000000161 DESC, :"SYS_B_9" ASC;
Explained.
SQL> SELECT * FROM TABLE(dbms_xplan.display);
PLAN_TABLE_OUTPUT
Plan hash value: 1497650422
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 6634 | 524K| 2993 (19)| 00:00:01 |
| 1 | SORT ORDER BY | | 6634 | 524K| 2993 (19)| 00:00:01 |
| 2 | TABLE ACCESS BY INDEX ROWID| T2210 | 6634 | 524K| 2947 (17)| 00:00:01 |
|* 3 | INDEX RANGE SCAN | T2210_T | 6842 | | 108 (22)| 00:00:01 |
Predicate Information (identified by operation id):
3 - access("T2210"."C490008000"=:SYS_B_0 AND "T2210"."C490009100"=:SYS_B_2
AND "T2210"."C301363300"=TO_NUMBER(:SYS_B_1))
16 rows selected.Hi Dom,
Thanks for your immediate response.
I am getting two values for PLAN_TABLE. Please let me know if we need to drop any of them??
SQL> SELECT *
FROM all_objects
WHERE object_name = 'PLAN_TABLE'; 2 3
OWNER OBJECT_NAME SUBOBJECT_NAME OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE CREATED LAST_DDL_TIME TIMESTAMP STATUS T G S NAMESPACE EDITION_NAME
PUBLIC PLAN_TABLE 5127 SYNONYM 17-SEP-11 17-SEP-11 2011-09-17:09:47:47 VALID N N N 1
ARADMIN PLAN_TABLE 219426 219426 TABLE 07-APR-13 07-APR-13 2013-04-07:23:01:12 VALID N N N 1 -
Why the Image is not showing on Report at runtime?
Post Author: azharrahi
CA Forum: .NET
I am working on a web site which was developed in ASP.Net 1.1. This web site also contains Crystal Reports version 9.
Now I have loaded the web site in Visual Studio.net 2005 and hence in ASP.Net 2.0. Still the Crystal reports version is 9.
Everything is ok and Crystal reports are showing data properly.
But one thing is very strange and annoyable.i.e. When I insert image on Crystal Reports through right click-> Insert->Picture, the image is shown in the design time preview of report, but when I load the Crystal Report on .Net control CrystalReportViewer and run the application, the Image is not displayed. The problem becomes more strange when I Export the Crystal Report to PDF file and MS Excel. Strangely the Image is also exported there and is displayed. Whats the problem? Why Image is not displayed on the CrystalreportViewer of the form on run time and why on exporting to PDF file and MS Excel, it is displayed? Can any body tell me whats the problem behind of not displaying image on runtime?
At least it means that Image is embeded and loaded on runtime. Only now viewing. Only a blank Picture box displayed.Post Author: Argan
CA Forum: .NET
A couple things can cause this.
Right click on the red x to find out the name of the png file. Search the web server for that png and make sure that the asp worker has access to it.
The other is a image handler issue. Search the kbase for Red X NET 2005 and you will find a kbase or two that addresses this. -
Why the Image dose not show?
the program can run, however, the image just dose not show on the container, I've mad ....
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.image.*;
import java.awt.geom.*;
import javax.imageio.*;
import java.io.*;
public class gui extends JFrame{
private stack s=new stack();
private queue q1=new queue();
private queue q2=new queue();
private JRadioButton rbutton1,rbutton2,rbutton3,rbutton4,rbutton5;
private JTextArea point1,point2,infoarea;
private JButton ok ,exit;
int state=0;
private JLabel b=new JLabel(new ImageIcon("abc.jpg"));
public gui() {
creatUserInterface();
private void creatUserInterface(){
Container contentPane=getContentPane();
contentPane.setLayout(null);
b.setBounds(0, 0,127,127);
contentPane.add(b);
rbutton1=new JRadioButton();
rbutton1.setBounds(45, 270, 20,20);
rbutton1.setBackground(Color.decode("170800"));
contentPane.add(rbutton1);
rbutton2=new JRadioButton();
rbutton2.setBounds(145, 270, 20,20);
rbutton2.setBackground(Color.decode("170800"));
contentPane.add(rbutton2);
rbutton3=new JRadioButton();
rbutton3.setBounds(245, 270, 20,20);
rbutton3.setBackground(Color.decode("170800"));
contentPane.add(rbutton3);
rbutton4=new JRadioButton();
rbutton4.setBounds(345, 270, 20,20);
rbutton4.setBackground(Color.decode("170800"));
contentPane.add(rbutton4);
rbutton5=new JRadioButton();
rbutton5.setBounds(445, 270, 20,20);
rbutton5.setBackground(Color.decode("170800"));
contentPane.add(rbutton5);
point1=new JTextArea();
point1.setBounds(585, 20, 43, 20);
contentPane.add(point1);
point2=new JTextArea();
point2.setBounds(585, 205, 43, 20);
contentPane.add(point2);
infoarea=new JTextArea();
infoarea.setBounds(30, 300, 450, 100);
infoarea.setText("click \"ok \" to start game, click \"exit \" to exit");
contentPane.add(infoarea);
ok=new JButton();
ok.setBounds(520, 255, 75, 60);
ok.setText("OK");
contentPane.add(ok);
ok.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event){
okButton(event);
exit=new JButton();
exit.setBounds(520, 340, 75, 65);
exit.setText("EXIT");
contentPane.add(exit);
exit.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event){
exitButton(event);
contentPane.setBackground(Color.decode("170800"));
setTitle("Change it or Not");
setSize(640, 480);
setVisible(true);
Message was edited by:
explosivealanbecause the code is very long and i just cut the code i think is not related, i post all the code here, should i post the code of stack , queue and others class?My objective is to show all cardLabel as jpg, abc is to test only.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.image.*;
import java.awt.geom.*;
import javax.imageio.*;
import java.io.*;
public class gui extends JFrame{
private stack s=new stack(); // a stack with 52 node to store 52 cards
private queue q1=new queue(); // a queue to hold the computer player's cards
private queue q2=new queue(); // a queue to hold the human player's cards
private cardoperation op=new cardoperation(); // contain all card operation that require to run the game
private handcompare hc=new handcompare(); // pass two queue to handcompare, if the first queue defealt the second queue, return true, otherwise reture false
private JLabel cardlabel1,cardlabel2,cardlabel3,cardlabel4,cardlabel5,cardlabel6,cardlabel7,cardlabel8,cardlabel9,cardlabel10; // label to show the cards
private JLabel computerpoint,playerpoint,inputbet,dollarsign;
private JRadioButton rbutton1,rbutton2,rbutton3,rbutton4,rbutton5; //radio button for selecting which card to be changed
private JTextField bet; //Textfield to input the amount of bet
private JTextArea point1,point2,infoarea; //textarea to show player's point and futher infomation;
private JButton ok ,exit; //button to confirm or to exit game
int compoint=10000,playpoint=10000; // integer to store the player's current point;'
int betamount; // integer to store the current bet amount
int state=0; // store the state of the program
private JLabel b=new JLabel(new ImageIcon("abc.jpg"));
public gui() {
super();
creatUserInterface();
private void creatUserInterface(){
Container contentPane=getContentPane();
contentPane.setLayout(null);
cardlabel1=new JLabel();
cardlabel1.setBounds(50, 15, 50, 30);
cardlabel1.setText("");
contentPane.add(cardlabel1);
b.setBounds(0, 0,127,127);
contentPane.add(b);
cardlabel2=new JLabel();
cardlabel2.setBounds(150, 15, 50, 30);
cardlabel2.setText("");
contentPane.add(cardlabel2);
cardlabel3=new JLabel();
cardlabel3.setBounds(250, 15, 50, 30);
cardlabel3.setText("");
contentPane.add(cardlabel3);
cardlabel4=new JLabel();
cardlabel4.setBounds(350, 15, 50, 30);
cardlabel4.setText("");
contentPane.add(cardlabel4);
cardlabel5=new JLabel();
cardlabel5.setBounds(450, 15, 50, 30);
cardlabel5.setText("");
contentPane.add(cardlabel5);
cardlabel6=new JLabel();
cardlabel6.setBounds(50, 200, 50, 30);
cardlabel6.setText("");
contentPane.add(cardlabel6);
cardlabel7=new JLabel();
cardlabel7.setBounds(150, 200, 50, 30);
cardlabel7.setText("");
contentPane.add(cardlabel7);
cardlabel8=new JLabel();
cardlabel8.setBounds(250, 200, 50, 30);
cardlabel8.setText("");
contentPane.add(cardlabel8);
cardlabel9=new JLabel();
cardlabel9.setBounds(350, 200, 50, 30);
cardlabel9.setText("");
contentPane.add(cardlabel9);
cardlabel10=new JLabel();
cardlabel10.setBounds(450, 200, 50, 30);
cardlabel10.setText("");
contentPane.add(cardlabel10);
rbutton1=new JRadioButton();
rbutton1.setBounds(45, 270, 20,20);
rbutton1.setBackground(Color.decode("170800"));
contentPane.add(rbutton1);
rbutton2=new JRadioButton();
rbutton2.setBounds(145, 270, 20,20);
rbutton2.setBackground(Color.decode("170800"));
contentPane.add(rbutton2);
rbutton3=new JRadioButton();
rbutton3.setBounds(245, 270, 20,20);
rbutton3.setBackground(Color.decode("170800"));
contentPane.add(rbutton3);
rbutton4=new JRadioButton();
rbutton4.setBounds(345, 270, 20,20);
rbutton4.setBackground(Color.decode("170800"));
contentPane.add(rbutton4);
rbutton5=new JRadioButton();
rbutton5.setBounds(445, 270, 20,20);
rbutton5.setBackground(Color.decode("170800"));
contentPane.add(rbutton5);
computerpoint=new JLabel();
computerpoint.setBounds(500, 15, 80, 30);
computerpoint.setText("computer has");
contentPane.add(computerpoint);
playerpoint=new JLabel();
playerpoint.setBounds(500, 200, 80, 30);
playerpoint.setText("you have");
contentPane.add(playerpoint);
inputbet=new JLabel();
inputbet.setBounds(500, 90, 130, 20);
inputbet.setText("please input bet here");
contentPane.add(inputbet);
dollarsign=new JLabel();
dollarsign.setBounds(510, 115, 20, 20);
dollarsign.setText("$");
contentPane.add(dollarsign);
point1=new JTextArea();
point1.setBounds(585, 20, 43, 20);
contentPane.add(point1);
point2=new JTextArea();
point2.setBounds(585, 205, 43, 20);
contentPane.add(point2);
infoarea=new JTextArea();
infoarea.setBounds(30, 300, 450, 100);
infoarea.setText("click \"ok \" to start game, click \"exit \" to exit");
contentPane.add(infoarea);
bet=new JTextField();
bet.setBounds(530, 115, 60, 20);
contentPane.add(bet);
ok=new JButton();
ok.setBounds(520, 255, 75, 60);
ok.setText("OK");
contentPane.add(ok);
ok.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event){
okButton(event);
exit=new JButton();
exit.setBounds(520, 340, 75, 65);
exit.setText("EXIT");
contentPane.add(exit);
exit.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event){
exitButton(event);
contentPane.setBackground(Color.decode("170800"));
setTitle("Change it or Not");
setSize(640, 480);
setVisible(true);
private void displayLabel(){
int a[]=new int[5];
int b[]=new int[5];
String a1[]=new String[5];
String b1[]=new String[5];
a=q1.copy_queue();
b=q2.copy_queue();
int i;
for(i=0;i<5;i++){
if(a%100==13) a1[i]="A";
else if(a[i]%100>0&&a[i]%100<10)a1[i]=String.valueOf(a[i]%100+1);
else if(a[i]%100==10)a1[i]="J";
else if(a[i]%100==11)a1[i]="Q";
else if(a[i]%100==12)a1[i]="K";
for(i=0;i<5;i++){
if(b[i]%100==13) b1[i]="A";
else if(b[i]%100>0&&b[i]%100<10)b1[i]=String.valueOf(b[i]%100+1);
else if(b[i]%100==10)b1[i]="J";
else if(b[i]%100==11)b1[i]="Q";
else if(b[i]%100==12)b1[i]="K";
cardlabel1.setText(a1[0]);
if(a[0]/100==4)
cardlabel1.setForeground(Color.PINK);
else if(a[0]/100==3)
cardlabel1.setForeground(Color.BLUE);
else if(a[0]/100==2)
cardlabel1.setForeground(Color.RED);
else if(a[0]/100==1)
cardlabel1.setForeground(Color.BLACK);
cardlabel2.setText(a1[1]);
if(a[1]/100==4)
cardlabel2.setForeground(Color.PINK);
else if(a[1]/100==3)
cardlabel2.setForeground(Color.BLUE);
else if(a[1]/100==2)
cardlabel2.setForeground(Color.RED);
else if(a[1]/100==1)
cardlabel2.setForeground(Color.BLACK);
cardlabel3.setText(a1[2]);
if(a[2]/100==4)
cardlabel3.setForeground(Color.PINK);
else if(a[2]/100==3)
cardlabel3.setForeground(Color.BLUE);
else if(a[2]/100==2)
cardlabel3.setForeground(Color.RED);
else if(a[2]/100==1)
cardlabel3.setForeground(Color.BLACK);
cardlabel4.setText(a1[3]);
if(a[3]/100==4)
cardlabel4.setForeground(Color.PINK);
else if(a[3]/100==3)
cardlabel4.setForeground(Color.BLUE);
else if(a[3]/100==2)
cardlabel4.setForeground(Color.RED);
else if(a[3]/100==1)
cardlabel4.setForeground(Color.BLACK);
cardlabel5.setText(a1[4]);
if(a[4]/100==4)
cardlabel5.setForeground(Color.PINK);
else if(a[4]/100==3)
cardlabel5.setForeground(Color.BLUE);
else if(a[4]/100==2)
cardlabel5.setForeground(Color.RED);
else if(a[4]/100==1)
cardlabel5.setForeground(Color.BLACK);
cardlabel6.setText(b1[0]);
if(b[0]/100==4)
cardlabel6.setForeground(Color.PINK);
else if(b[0]/100==3)
cardlabel6.setForeground(Color.BLUE);
else if(b[0]/100==2)
cardlabel6.setForeground(Color.RED);
else if(b[0]/100==1)
cardlabel6.setForeground(Color.BLACK);
cardlabel7.setText(b1[1]);
if(b[1]/100==4)
cardlabel7.setForeground(Color.PINK);
else if(b[1]/100==3)
cardlabel7.setForeground(Color.BLUE);
else if(b[1]/100==2)
cardlabel7.setForeground(Color.RED);
else if(b[1]/100==1)
cardlabel7.setForeground(Color.BLACK);
cardlabel8.setText(b1[2]);
if(b[2]/100==4)
cardlabel8.setForeground(Color.PINK);
else if(b[2]/100==3)
cardlabel8.setForeground(Color.BLUE);
else if(b[2]/100==2)
cardlabel8.setForeground(Color.RED);
else if(b[2]/100==1)
cardlabel8.setForeground(Color.BLACK);
cardlabel9.setText(b1[3]);
if(b[3]/100==4)
cardlabel9.setForeground(Color.PINK);
else if(b[3]/100==3)
cardlabel9.setForeground(Color.BLUE);
else if(b[3]/100==2)
cardlabel9.setForeground(Color.RED);
else if(b[3]/100==1)
cardlabel9.setForeground(Color.BLACK);
cardlabel10.setText(b1[4]);
if(b[4]/100==4)
cardlabel10.setForeground(Color.PINK);
else if(b[4]/100==3)
cardlabel10.setForeground(Color.BLUE);
else if(b[4]/100==2)
cardlabel10.setForeground(Color.RED);
else if(b[4]/100==1)
cardlabel10.setForeground(Color.BLACK);
point1.setText("$"+String.valueOf(compoint)); //show the value back if player has change it accdentially
point2.setText("$"+String.valueOf(playpoint));
if(betamount==0)
bet.setText("");
else
bet.setText(String.valueOf(betamount));
private void displayHalf(){
int b[]=new int[5];
String b1[]=new String[5];
b=q2.copy_queue();
int i;
for(i=0;i<5;i++){
if(b[i]%100==13) b1[i]="A";
else if(b[i]%100>0&&b[i]%100<10)b1[i]=String.valueOf(b[i]%100+1);
else if(b[i]%100==10)b1[i]="J";
else if(b[i]%100==11)b1[i]="Q";
else if(b[i]%100==12)b1[i]="K";
cardlabel6.setText(b1[0]);
if(b[0]/100==4)
cardlabel6.setForeground(Color.PINK);
else if(b[0]/100==3)
cardlabel6.setForeground(Color.BLUE);
else if(b[0]/100==2)
cardlabel6.setForeground(Color.RED);
else if(b[0]/100==1)
cardlabel6.setForeground(Color.BLACK);
cardlabel7.setText(b1[1]);
if(b[1]/100==4)
cardlabel7.setForeground(Color.PINK);
else if(b[1]/100==3)
cardlabel7.setForeground(Color.BLUE);
else if(b[1]/100==2)
cardlabel7.setForeground(Color.RED);
else if(b[1]/100==1)
cardlabel7.setForeground(Color.BLACK);
cardlabel8.setText(b1[2]);
if(b[2]/100==4)
cardlabel8.setForeground(Color.PINK);
else if(b[2]/100==3)
cardlabel8.setForeground(Color.BLUE);
else if(b[2]/100==2)
cardlabel8.setForeground(Color.RED);
else if(b[2]/100==1)
cardlabel8.setForeground(Color.BLACK);
cardlabel9.setText(b1[3]);
if(b[3]/100==4)
cardlabel9.setForeground(Color.PINK);
else if(b[3]/100==3)
cardlabel9.setForeground(Color.BLUE);
else if(b[3]/100==2)
cardlabel9.setForeground(Color.RED);
else if(b[3]/100==1)
cardlabel9.setForeground(Color.BLACK);
cardlabel10.setText(b1[4]);
if(b[4]/100==4)
cardlabel10.setForeground(Color.PINK);
else if(b[4]/100==3)
cardlabel10.setForeground(Color.BLUE);
else if(b[4]/100==2)
cardlabel10.setForeground(Color.RED);
else if(b[4]/100==1)
cardlabel10.setForeground(Color.BLACK);
cardlabel1.setText("");
cardlabel2.setText("");
cardlabel3.setText("");
cardlabel4.setText("");
cardlabel5.setText("");
point1.setText("$"+String.valueOf(compoint)); //show the value back if player has change it accdentially
point2.setText("$"+String.valueOf(playpoint));
if(betamount==0)
bet.setText("");
else
bet.setText(String.valueOf(betamount));
private void okButton(ActionEvent event){
switch(state){
case(0):{
op.reshuffle(s);
op.CardDistribe(s, q1, q2);
displayHalf();
infoarea.setText("please input your bet and click \"ok \" \n\nSpace is Black Heart is Red \nClub is Bleu Diamond is Pink");
break;
case(1):{
try{
betamount=Integer.parseInt(bet.getText());
catch(NumberFormatException e){
infoarea.setText("invaild input, please try again");
state=state-1;
if(state==1)
if(betamount<=0||betamount>playpoint)
{infoarea.setText("please input between 1 & "+String.valueOf(playpoint));
state=state-1;}
else
{infoarea.setText("please choose the cards to be changed \n\nSpace is Black Heart is Red \nClub is Bleu Diamond is Pink");
displayLabel();}
break;
case(2):{
infoarea.setText("choosed card has been changed");
int a[]=new int[5];
for(int i=0;i<5;i++)
a[i]=0;
if(rbutton1.isSelected())
a[0]=1;
if(rbutton2.isSelected())
a[1]=1;
if(rbutton3.isSelected())
a[2]=1;
if(rbutton4.isSelected())
a[3]=1;
if(rbutton5.isSelected())
a[4]=1;
op.computerChangeCard(s, q1, hc);
op.playerChangeCard(s, q2, a);
displayLabel();
break;
case(3):{
if(hc.compare(q1, q2)){
infoarea.setText("you loss\n\nclick \"ok \" to continue");
playpoint=playpoint-betamount;
compoint=compoint+betamount;
else{
infoarea.setText("you win\n\nclick \"ok \" to continue");
playpoint=playpoint+betamount;
compoint=compoint-betamount;
betamount=0;
displayLabel();
if(playpoint<=0)
infoarea.setText("you have loss the game, press \"ok \" or \"exit \" to end game");
else if(compoint<=0)
infoarea.setText("you have win the game, press \"ok \" or \"exit \" to end game");
else{
state=-1;
break;
case(4):{
exit(); // player's point <=0, so force to exit'
default:
rbutton1.setSelected(false);
rbutton2.setSelected(false);
rbutton3.setSelected(false);
rbutton4.setSelected(false);
rbutton5.setSelected(false);
state=state+1;
private void exitButton(ActionEvent event){
exit();
private void exit(){
System.exit(0); -
EXPLAIN PLAN not showing no of records
Rows column in the TKPROF output shows zero columns. The same works fine at sqlplus level, when autotrace set to ON.
Explain plan looks like below:
Rows Execution Plan
0 SELECT STATEMENT GOAL: ALL_ROWS
0 WINDOW (SORT)
0 HASH (GROUP BY)
0 MAT_VIEW ACCESS (BY INDEX ROWID) OF 'FII_AR_NET_REC_BASE_MV'
(MAT_VIEW)
0 NESTED LOOPS
0 MERGE JOIN (CARTESIAN)
0 TABLE ACCESS (FULL) OF 'FII_AR_SUMMARY_GT' (TABLE
(TEMP))
0 BUFFER (SORT)
0 INLIST ITERATOR
0 TABLE ACCESS GOAL: ANALYZED (BY INDEX ROWID) OF
'FII_TIME_STRUCTURES' (TABLE)
Can someone help me here ?
Thanks.Hi,
it's becuz of when u execute query twice its no I/O .data are already in buffer pool.
Thanks
Reena -
Why the oval is not showing up?
heres my code:
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
public class myApplet extends java.applet.Applet {
boolean initialization = true;
int centerX, centerY, maxX, maxY;
float pixelSize, rWidth = 400.0F, rHeight = 400.0F;
BufferedImage gBuffer;
void initializeGraphics()
Dimension d = canvas1.getSize();
maxX = d.width - 1; maxY = d.height - 1;
pixelSize = Math.max((rWidth)/maxX, (rHeight)/maxY);
centerX = maxX/2; centerY = maxY/2;
int iX(float x){return Math.round(centerX + x/pixelSize);}
int iY(float y){return Math.round(centerY - y/pixelSize);}
float fx(int x){return ((x - centerX) * pixelSize);}
float fy(int y){return ((centerY - y) * pixelSize);}
void clearGraphics(Graphics g) {
g.setColor(Color.WHITE);
g.fillRect(0,0, maxX, maxY);
/** Initializes the applet Trans2D */
public void init() {
try {
java.awt.EventQueue.invokeAndWait(new Runnable() {
public void run() {
initComponents();
} catch (Exception ex) {
ex.printStackTrace();
this.setSize(700, 700);
gBuffer = new BufferedImage((int)rWidth, (int)rHeight, BufferedImage.TYPE_INT_ARGB);
/** This method is called from within the init() method to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
canvas1 = new mycanvas();
jScrollBarPoints = new javax.swing.JScrollBar();
jLabelNoPoints = new javax.swing.JLabel();
canvas1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
canvas1MousePressed(evt);
jScrollBarPoints.setMaximum(25);
jScrollBarPoints.setMinimum(3);
jScrollBarPoints.setOrientation(javax.swing.JScrollBar.HORIZONTAL);
jScrollBarPoints.addAdjustmentListener(new java.awt.event.AdjustmentListener() {
public void adjustmentValueChanged(java.awt.event.AdjustmentEvent evt) {
jScrollBarPointsAdjustmentValueChanged(evt);
jLabelNoPoints.setText("3");
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(org.jdesktop.layout.GroupLayout.LEADING, jScrollBarPoints, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.LEADING, canvas1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE))
.add(18, 18, 18)
.add(jLabelNoPoints, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 30, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(296, 296, 296))
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLabelNoPoints)
.add(layout.createSequentialGroup()
.add(jScrollBarPoints, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(canvas1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 452, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
.add(20, 20, 20))
}// </editor-fold>
private void canvas1MousePressed(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
Graphics g = gBuffer.getGraphics();
g.drawOval(evt.getX(), evt.getY(), 10, 10);
g.fillOval(evt.getX(), evt.getY(), 10, 10);
private void jScrollBarPointsAdjustmentValueChanged(java.awt.event.AdjustmentEvent evt) {
jLabelNoPoints.setText(""+jScrollBarPoints.getValue());
// Variables declaration - do not modify
private java.awt.Canvas canvas1;
private javax.swing.JLabel jLabelNoPoints;
private javax.swing.JScrollBar jScrollBarPoints;
// End of variables declaration
public class mycanvas extends java.awt.Canvas {
public void paint(Graphics g){
super.paint(g);
my question is.when i press with the mouse on canvas1 why it doesnt draw an oval in that X,Y ? How can I solve that? Thanks!import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
public class myApplet extends java.applet.Applet {
boolean initialization = true;
int centerX, centerY, maxX, maxY;
float pixelSize, rWidth = 400.0F, rHeight = 400.0F;
BufferedImage gBuffer;
void initializeGraphics()
Dimension d = canvas1.getSize();
maxX = d.width - 1; maxY = d.height - 1;
pixelSize = Math.max((rWidth)/maxX, (rHeight)/maxY);
centerX = maxX/2; centerY = maxY/2;
int iX(float x){return Math.round(centerX + x/pixelSize);}
int iY(float y){return Math.round(centerY - y/pixelSize);}
float fx(int x){return ((x - centerX) * pixelSize);}
float fy(int y){return ((centerY - y) * pixelSize);}
void clearGraphics(Graphics g) {
g.setColor(Color.WHITE);
g.fillRect(0,0, maxX, maxY);
/** Initializes the applet Trans2D */
public void init() {
try {
java.awt.EventQueue.invokeAndWait(new Runnable() {
public void run() {
initComponents();
} catch (Exception ex) {
ex.printStackTrace();
this.setSize(700, 700);
gBuffer = new BufferedImage((int)rWidth, (int)rHeight, BufferedImage.TYPE_INT_ARGB);
/** This method is called from within the init() method to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
canvas1 = new mycanvas();
jScrollBarPoints = new javax.swing.JScrollBar();
jLabelNoPoints = new javax.swing.JLabel();
canvas1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
canvas1MousePressed(evt);
jScrollBarPoints.setMaximum(25);
jScrollBarPoints.setMinimum(3);
jScrollBarPoints.setOrientation(javax.swing.JScrollBar.HORIZONTAL);
jScrollBarPoints.addAdjustmentListener(new java.awt.event.AdjustmentListener() {
public void adjustmentValueChanged(java.awt.event.AdjustmentEvent evt) {
jScrollBarPointsAdjustmentValueChanged(evt);
jLabelNoPoints.setText("3");
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(org.jdesktop.layout.GroupLayout.LEADING, jScrollBarPoints, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.LEADING, canvas1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE))
.add(18, 18, 18)
.add(jLabelNoPoints, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 30, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(296, 296, 296))
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLabelNoPoints)
.add(layout.createSequentialGroup()
.add(jScrollBarPoints, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(canvas1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 452, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
.add(20, 20, 20))
}// </editor-fold>
private void canvas1MousePressed(java.awt.event.MouseEvent evt) {
Graphics g = gBuffer.getGraphics ();
g.setColor (Color.RED);
g.fillOval (evt.getX (), evt.getY (), 10, 10);
g.setColor (Color.BLUE);
g.drawOval (evt.getX(), evt.getY(), 10, 10);
private void jScrollBarPointsAdjustmentValueChanged(java.awt.event.AdjustmentEvent evt) {
jLabelNoPoints.setText(""+jScrollBarPoints.getValue());
// Variables declaration - do not modify
private java.awt.Canvas canvas1;
private javax.swing.JLabel jLabelNoPoints;
private javax.swing.JScrollBar jScrollBarPoints;
// End of variables declaration
public class mycanvas extends java.awt.Canvas {
public void paint(Graphics g){
super.paint (g);
g.drawImage (gBuffer, 0, 0, null);
}still nothing? is it so difficult to do such an easy thing? -
Why the subvi can not show,when i use call by reference node.
I used a call by reference node in function pallete,i follow the labview manuals and examples(dynamic load example), but i can not see the subvi show when the program running.
Attachments:
comshow.vi 75 KB
交流稳态频谱.vi 19 KBHi Sunny,
Open your subVI,
1. go to File->Vi Properties (or Ctrl+I)
2. choose Window Appearance category
3. choose Customize
4. check "Show Front Panel When Called" (and "Close Afterwards ..")
5. save the VI, close it and try again.
Let us know if it's OK ... -
Explain plan not available in dba studio
Hi, guys,
Why the explain plan not available in my dba studio with a message like this "explain plan not available for this sql statement. ora-02195: attempt to create permanent object in a temporary tablespace"
Another question: I can use "set autotrace on" to trace sql statement in sql*plus window. But the final execution plan come up without those thing like cost, cardinality but only the steps
Thanks for your help
jimWas this a trace started on an already running task? Was the trace stopped before the task completed? Did the trace file reach its set size limit before the task compled?
In all three cases above you would have cursors that were not closed and stats information not written to the trace file resulting in incomplete data for some SQL.
HTH -- Mark D Powell -- -
DECODE is changing the explain plan
I have a statement with a decode function in the where clause like this:
AND decode(:cropcode,-1,'-1',sdu.u_crop_group) = decode(:cropcode,-1,'-1',:cropcode)When I a pass -1 as parameter for cropgroup the filter would result in "AND '-1' = '-1' and the statement is executed in less than 2 seconds. When I leave out this where clause it takes almost 18 seconds. The result is the same so I don't understand why the explain plan is so much different and why not using index scans in the statement without decode.
Below the explain plans and tkprofs for 1 (without decode) and 2 (with decode).
*explain 1*
{code}
SQL Statement which produced this data:
select * from table(dbms_xplan.display)
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)|
| 0 | SELECT STATEMENT | | 7080 | 2413K| | 43611 (2)|
| 1 | SORT ORDER BY | | 7080 | 2413K| 5224K| 43611 (2)|
|* 2 | FILTER | | | | | |
|* 3 | HASH JOIN | | 7156 | 2438K| | 43075 (2)|
| 4 | TABLE ACCESS FULL | DWH_ABS_DETERMINATION | 17745 | 363K| | 83 (0)|
|* 5 | HASH JOIN OUTER | | 7156 | 2292K| | 42991 (2)|
|* 6 | HASH JOIN | | 7156 | 1355K| | 42907 (2)|
|* 7 | HASH JOIN | | 6987 | 1187K| | 19170 (2)|
|* 8 | HASH JOIN | | 6947 | 963K| | 10376 (1)|
|* 9 | TABLE ACCESS BY INDEX ROWID | ALIQUOT | 3 | 144 | | 3 (0)|
| 10 | NESTED LOOPS | | 6907 | 897K| | 8577 (1)|
|* 11 | HASH JOIN | | 2264 | 187K| | 1782 (2)|
| 12 | TABLE ACCESS BY INDEX ROWID | SAMPLE | 190 | 4370 | | 17 (0)|
| 13 | NESTED LOOPS | | 2264 | 152K| | 107 (1)|
| 14 | NESTED LOOPS | | 12 | 552 | | 25 (0)|
|* 15 | TABLE ACCESS FULL | SDG_USER | 12 | 288 | | 13 (0)|
| 16 | TABLE ACCESS BY INDEX ROWID| SDG | 1 | 22 | | 1 (0)|
|* 17 | INDEX UNIQUE SCAN | PK_SDG | 1 | | | 0 (0)|
|* 18 | INDEX RANGE SCAN | FK_SAMPLE_SDG | 597 | | | 2 (0)|
| 19 | TABLE ACCESS FULL | SAMPLE_USER | 1078K| 16M| | 1669 (1)|
|* 20 | INDEX RANGE SCAN | FK_ALIQUOT_SAMPLE | 3 | | | 2 (0)|
| 21 | TABLE ACCESS FULL | ALIQUOT_USER | 3403K| 29M| | 1781 (3)|
| 22 | TABLE ACCESS FULL | TEST | 3423K| 104M| | 8775 (2)|
|* 23 | TABLE ACCESS FULL | RESULT | 3435K| 65M| | 23718 (2)|
| 24 | VIEW | PLATE | 21787 | 2851K| | 84 (2)|
|* 25 | FILTER | | | | | |
| 26 | TABLE ACCESS FULL | PLATE | 21787 | 574K| | 84 (2)|
|* 27 | INDEX UNIQUE SCAN | PK_OPERATOR_GROUP | 1 | 7 | | 0 (0)|
|* 28 | INDEX UNIQUE SCAN | PK_OPERATOR_GROUP | 1 | 7 | | 0 (0)|
|* 29 | INDEX UNIQUE SCAN | PK_OPERATOR_GROUP | 1 | 7 | | 0 (0)|
|* 30 | INDEX UNIQUE SCAN | PK_OPERATOR_GROUP | 1 | 7 | | 0 (0)|
|* 31 | INDEX UNIQUE SCAN | PK_OPERATOR_GROUP | 1 | 7 | | 0 (0)|
Predicate Information (identified by operation id):
2 - filter(("GROUP_ID" IS NULL OR EXISTS (SELECT /*+ */ 0 FROM "LIMS"."OPERATOR_GROUP"
"OPERATOR_GROUP" WHERE "OPERATOR_ID"="LIMS$OPERATOR_ID"() AND "GROUP_ID"=:B1)) AND ("GROUP_ID" IS NULL
OR EXISTS (SELECT /*+ */ 0 FROM "LIMS"."OPERATOR_GROUP" "OPERATOR_GROUP" WHERE
"OPERATOR_ID"="LIMS$OPERATOR_ID"() AND "GROUP_ID"=:B2)) AND ("GROUP_ID" IS NULL OR EXISTS (SELECT /*+
*/ 0 FROM "LIMS"."OPERATOR_GROUP" "OPERATOR_GROUP" WHERE "OPERATOR_ID"="LIMS$OPERATOR_ID"() AND
"GROUP_ID"=:B3)) AND ("GROUP_ID" IS NULL OR EXISTS (SELECT /*+ */ 0 FROM "LIMS"."OPERATOR_GROUP"
"OPERATOR_GROUP" WHERE "OPERATOR_ID"="LIMS$OPERATOR_ID"() AND "GROUP_ID"=:B4)))
3 - access("U_ABS_DETERMINATION"="DETERMINATION_ASSIGNMENT")
5 - access("PLT"."PLATE_ID"(+)="PLATE_ID")
6 - access("TEST_ID"="TEST_ID")
7 - access("ALIQUOT_ID"="ALIQUOT_ID")
8 - access("ALIQUOT_ID"="ALIQUOT_ID")
9 - filter("STATUS"='C' OR "STATUS"='P' OR "STATUS"='V')
11 - access("SAMPLE_ID"="SAMPLE_ID")
15 - filter("U_ABS_DETERMINATION" IS NOT NULL AND "U_CLIENT_TYPE"='QC' AND
"U_WEEK_OF_PROCESSING"=TO_NUMBER(:WEEK) AND "U_YEAR_OF_SAMPLE_DELIVERY"=TO_NUMBER(:YEAR))
17 - access("SDG_ID"="SDG_ID")
18 - access("SDG_ID"="SDG_ID")
20 - access("SAMPLE_ID"="SAMPLE_ID")
23 - filter("NAME"='End result')
25 - filter("GROUP_ID" IS NULL OR EXISTS (SELECT /*+ */ 0 FROM "LIMS"."OPERATOR_GROUP"
"OPERATOR_GROUP" WHERE "OPERATOR_ID"="LIMS$OPERATOR_ID"() AND "GROUP_ID"=:B1))
27 - access("GROUP_ID"=:B1 AND "OPERATOR_ID"="LIMS$OPERATOR_ID"())
28 - access("GROUP_ID"=:B1 AND "OPERATOR_ID"="LIMS$OPERATOR_ID"())
29 - access("GROUP_ID"=:B1 AND "OPERATOR_ID"="LIMS$OPERATOR_ID"())
30 - access("GROUP_ID"=:B1 AND "OPERATOR_ID"="LIMS$OPERATOR_ID"())
31 - access("GROUP_ID"=:B1 AND "OPERATOR_ID"="LIMS$OPERATOR_ID"())
Note
- 'PLAN_TABLE' is old version
{code}
*tkprof 1*
{code}
TKPROF: Release 10.2.0.3.0 - Production on Tue Jan 13 13:21:47 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Trace file: C:\oracle\product\10.2.0\admin\nautp02\udump\nautp02_ora_880.trc
Sort options: default
count = number of times OCI procedure was executed
cpu = cpu time in seconds executing
elapsed = elapsed time in seconds executing
disk = number of physical reads of buffers from disk
query = number of buffers gotten for consistent read
current = number of buffers gotten in current mode (usually for update)
rows = number of rows processed by the fetch or execute call
SELECT sdu.u_crop_group,
sd.name as sdg_name,
ad.variety_name,
ad.batch_number,
a.name as aliquot_name,
sau.u_box_code as box_code,
sau.u_box_position as box_position,
t.name as test_name,
r.original_result,
plt.name as plate_name,
concat(chr(a.plate_row + 64),a.plate_column) as plate_position,
au.u_replicate_number as replicate_number
FROM lims_sys.sdg sd,
lims_sys.sdg_user sdu,
lims_sys.sample sa,
lims_sys.sample_user sau,
lims_sys.aliquot a,
lims_sys.aliquot_user au,
lims_sys.test t,
lims_sys.result r,
lims_sys.plate plt,
lims_sys.abs_determination ad
WHERE sd.sdg_id = sdu.sdg_id
AND sd.sdg_id = sa.sdg_id
AND sa.sample_id = sau.sample_id
AND sau.sample_id = a.sample_id
AND a.aliquot_id = au.aliquot_id
AND au.aliquot_id = t.aliquot_id
AND t.test_id = r.test_id
AND plt.plate_id (+) = a.plate_id
AND sdu.u_abs_determination = ad.determination_assignment
AND a.status IN ('V','P','C')
AND r.name = 'End result'
AND sdu.u_client_type = 'QC'
AND sdu.u_year_of_sample_delivery = (:year)
AND sdu.u_week_of_processing = (:week)
--AND decode(:cropcode,-1,'-1',sdu.u_crop_group) = decode(:cropcode,-1,'-1',:cropcode)
ORDER BY box_code, box_position, replicate_number
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 1 1.15 1.16 0 0 0 0
Fetch 1 8.53 16.10 227649 241266 0 500
total 3 9.68 17.27 227649 241266 0 500
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 97
Rows Row Source Operation
500 SORT ORDER BY (cr=241266 pr=227649 pw=0 time=16104631 us)
21311 FILTER (cr=241266 pr=227649 pw=0 time=16246749 us)
21311 HASH JOIN (cr=241266 pr=227649 pw=0 time=16225434 us)
17745 TABLE ACCESS FULL DWH_ABS_DETERMINATION (cr=374 pr=0 pw=0 time=69 us)
21311 HASH JOIN RIGHT OUTER (cr=240892 pr=227649 pw=0 time=16170607 us)
21895 VIEW PLATE (cr=316 pr=0 pw=0 time=43825 us)
21895 FILTER (cr=316 pr=0 pw=0 time=43823 us)
21895 TABLE ACCESS FULL PLATE (cr=316 pr=0 pw=0 time=31 us)
0 INDEX UNIQUE SCAN PK_OPERATOR_GROUP (cr=0 pr=0 pw=0 time=0 us)(object id 45769)
21311 HASH JOIN (cr=240576 pr=227649 pw=0 time=16106174 us)
21311 HASH JOIN (cr=133559 pr=121596 pw=0 time=9594130 us)
21311 HASH JOIN (cr=94323 pr=83281 pw=0 time=6917067 us)
21311 HASH JOIN (cr=86383 pr=75547 pw=0 time=5509672 us)
7776 HASH JOIN (cr=8134 pr=0 pw=0 time=285364 us)
7776 TABLE ACCESS BY INDEX ROWID SAMPLE (cr=572 pr=0 pw=0 time=27152 us)
7876 NESTED LOOPS (cr=377 pr=0 pw=0 time=488287 us)
99 HASH JOIN (cr=160 pr=0 pw=0 time=4168 us)
99 TABLE ACCESS FULL SDG_USER (cr=53 pr=0 pw=0 time=1209 us)
5719 TABLE ACCESS FULL SDG (cr=107 pr=0 pw=0 time=17 us)
7776 INDEX RANGE SCAN FK_SAMPLE_SDG (cr=217 pr=0 pw=0 time=623 us)(object id 45990)
1079741 TABLE ACCESS FULL SAMPLE_USER (cr=7562 pr=0 pw=0 time=24 us)
3307948 TABLE ACCESS FULL ALIQUOT (cr=78249 pr=75547 pw=0 time=3331129 us)
3406836 TABLE ACCESS FULL ALIQUOT_USER (cr=7940 pr=7734 pw=0 time=556 us)
3406832 TABLE ACCESS FULL TEST (cr=39236 pr=38315 pw=0 time=3413192 us)
3406832 TABLE ACCESS FULL RESULT (cr=107017 pr=106053 pw=0 time=6848487 us)
0 INDEX UNIQUE SCAN PK_OPERATOR_GROUP (cr=0 pr=0 pw=0 time=0 us)(object id 45769)
0 INDEX UNIQUE SCAN PK_OPERATOR_GROUP (cr=0 pr=0 pw=0 time=0 us)(object id 45769)
0 INDEX UNIQUE SCAN PK_OPERATOR_GROUP (cr=0 pr=0 pw=0 time=0 us)(object id 45769)
0 INDEX UNIQUE SCAN PK_OPERATOR_GROUP (cr=0 pr=0 pw=0 time=0 us)(object id 45769)
select 'x'
from
dual
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 1 0.00 0.00 0 0 0 1
total 3 0.00 0.00 0 0 0 1
Misses in library cache during parse: 0
Optimizer mode: ALL_ROWS
Parsing user id: 97
Rows Row Source Operation
1 FAST DUAL (cr=0 pr=0 pw=0 time=3 us)
begin :id := sys.dbms_transaction.local_transaction_id; end;
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 1
Fetch 0 0.00 0.00 0 0 0 0
total 2 0.00 0.00 0 0 0 1
Misses in library cache during parse: 0
Optimizer mode: ALL_ROWS
Parsing user id: 97
OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 3 0.00 0.00 0 0 0 0
Execute 3 1.15 1.16 0 0 0 1
Fetch 2 8.53 16.10 227649 241266 0 501
total 8 9.68 17.27 227649 241266 0 502
Misses in library cache during parse: 1
Misses in library cache during execute: 1
OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 30 0.00 0.00 0 0 0 0
Execute 30 0.00 0.00 0 0 0 0
Fetch 30 0.00 0.00 0 40 0 10
total 90 0.00 0.00 0 40 0 10
Misses in library cache during parse: 0
3 user SQL statements in session.
30 internal SQL statements in session.
33 SQL statements in session.
Trace file: C:\oracle\product\10.2.0\admin\nautp02\udump\nautp02_ora_880.trc
Trace file compatibility: 10.01.00
Sort options: default
8 sessions in tracefile.
3 user SQL statements in trace file.
30 internal SQL statements in trace file.
33 SQL statements in trace file.
6 unique SQL statements in trace file.
633 lines in trace file.
23 elapsed seconds in trace file.
{code}explain 2
SQL Statement which produced this data:
select * from table(dbms_xplan.display)
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
| 0 | SELECT STATEMENT | | 71 | 24779 | 857 (1)|
| 1 | SORT ORDER BY | | 71 | 24779 | 857 (1)|
|* 2 | FILTER | | | | |
|* 3 | TABLE ACCESS BY INDEX ROWID | RESULT | 1 | 20 | 4 (0)|
| 4 | NESTED LOOPS | | 72 | 25128 | 856 (1)|
| 5 | NESTED LOOPS | | 70 | 23030 | 576 (1)|
|* 6 | HASH JOIN OUTER | | 69 | 20493 | 369 (1)|
| 7 | NESTED LOOPS | | 69 | 11247 | 285 (0)|
| 8 | NESTED LOOPS | | 69 | 10626 | 147 (0)|
| 9 | NESTED LOOPS | | 23 | 2438 | 78 (0)|
| 10 | NESTED LOOPS | | 23 | 2070 | 32 (0)|
| 11 | NESTED LOOPS | | 1 | 67 | 15 (0)|
| 12 | NESTED LOOPS | | 1 | 45 | 14 (0)|
|* 13 | TABLE ACCESS FULL | SDG_USER | 1 | 24 | 13 (0)|
| 14 | TABLE ACCESS BY INDEX ROWID| DWH_ABS_DETERMINATION | 1 | 21 | 1 (0)|
|* 15 | INDEX UNIQUE SCAN | PK_DWH_ABS_DETERMINATION | 1 | | 0 (0)|
| 16 | TABLE ACCESS BY INDEX ROWID | SDG | 1 | 22 | 1 (0)|
|* 17 | INDEX UNIQUE SCAN | PK_SDG | 1 | | 0 (0)|
| 18 | TABLE ACCESS BY INDEX ROWID | SAMPLE | 190 | 4370 | 17 (0)|
|* 19 | INDEX RANGE SCAN | FK_SAMPLE_SDG | 597 | | 2 (0)|
| 20 | TABLE ACCESS BY INDEX ROWID | SAMPLE_USER | 1 | 16 | 2 (0)|
|* 21 | INDEX UNIQUE SCAN | PK_SAMPLE_USER | 1 | | 1 (0)|
|* 22 | TABLE ACCESS BY INDEX ROWID | ALIQUOT | 3 | 144 | 3 (0)|
|* 23 | INDEX RANGE SCAN | FK_ALIQUOT_SAMPLE | 3 | | 2 (0)|
| 24 | TABLE ACCESS BY INDEX ROWID | ALIQUOT_USER | 1 | 9 | 2 (0)|
|* 25 | INDEX UNIQUE SCAN | PK_ALIQUOT_USER | 1 | | 1 (0)|
| 26 | VIEW | PLATE | 21787 | 2851K| 84 (2)|
|* 27 | FILTER | | | | |
| 28 | TABLE ACCESS FULL | PLATE | 21787 | 574K| 84 (2)|
|* 29 | INDEX UNIQUE SCAN | PK_OPERATOR_GROUP | 1 | 7 | 0 (0)|
| 30 | TABLE ACCESS BY INDEX ROWID | TEST | 1 | 32 | 3 (0)|
|* 31 | INDEX RANGE SCAN | FK_TEST_ALIQUOT | 1 | | 2 (0)|
|* 32 | INDEX RANGE SCAN | FK_RESULT_TEST | 2 | | 2 (0)|
|* 33 | INDEX UNIQUE SCAN | PK_OPERATOR_GROUP | 1 | 7 | 0 (0)|
|* 34 | INDEX UNIQUE SCAN | PK_OPERATOR_GROUP | 1 | 7 | 0 (0)|
|* 35 | INDEX UNIQUE SCAN | PK_OPERATOR_GROUP | 1 | 7 | 0 (0)|
|* 36 | INDEX UNIQUE SCAN | PK_OPERATOR_GROUP | 1 | 7 | 0 (0)|
Predicate Information (identified by operation id):
2 - filter(("GROUP_ID" IS NULL OR EXISTS (SELECT /*+ */ 0 FROM "LIMS"."OPERATOR_GROUP"
"OPERATOR_GROUP" WHERE "OPERATOR_ID"="LIMS$OPERATOR_ID"() AND "GROUP_ID"=:B1)) AND ("GROUP_ID"
IS NULL OR EXISTS (SELECT /*+ */ 0 FROM "LIMS"."OPERATOR_GROUP" "OPERATOR_GROUP" WHERE
"OPERATOR_ID"="LIMS$OPERATOR_ID"() AND "GROUP_ID"=:B2)) AND ("GROUP_ID" IS NULL OR EXISTS
(SELECT /*+ */ 0 FROM "LIMS"."OPERATOR_GROUP" "OPERATOR_GROUP" WHERE
"OPERATOR_ID"="LIMS$OPERATOR_ID"() AND "GROUP_ID"=:B3)) AND ("GROUP_ID" IS NULL OR EXISTS
(SELECT /*+ */ 0 FROM "LIMS"."OPERATOR_GROUP" "OPERATOR_GROUP" WHERE
"OPERATOR_ID"="LIMS$OPERATOR_ID"() AND "GROUP_ID"=:B4)))
3 - filter("NAME"='End result')
6 - access("PLT"."PLATE_ID"(+)="PLATE_ID")
13 - filter("U_ABS_DETERMINATION" IS NOT NULL AND "U_CLIENT_TYPE"='QC' AND
"U_WEEK_OF_PROCESSING"=TO_NUMBER(:WEEK) AND "U_YEAR_OF_SAMPLE_DELIVERY"=TO_NUMBER(:YEAR) AND
DECODE(:CROPCODE,(-1),'-1',"U_CROP_GROUP")=DECODE(:CROPCODE,(-1),'-1',:CROPCODE))
15 - access("U_ABS_DETERMINATION"="DETERMINATION_ASSIGNMENT")
17 - access("SDG_ID"="SDG_ID")
19 - access("SDG_ID"="SDG_ID")
21 - access("SAMPLE_ID"="SAMPLE_ID")
22 - filter("STATUS"='C' OR "STATUS"='P' OR "STATUS"='V')
23 - access("SAMPLE_ID"="SAMPLE_ID")
25 - access("ALIQUOT_ID"="ALIQUOT_ID")
27 - filter("GROUP_ID" IS NULL OR EXISTS (SELECT /*+ */ 0 FROM "LIMS"."OPERATOR_GROUP"
"OPERATOR_GROUP" WHERE "OPERATOR_ID"="LIMS$OPERATOR_ID"() AND "GROUP_ID"=:B1))
29 - access("GROUP_ID"=:B1 AND "OPERATOR_ID"="LIMS$OPERATOR_ID"())
31 - access("ALIQUOT_ID"="ALIQUOT_ID")
32 - access("TEST_ID"="TEST_ID")
33 - access("GROUP_ID"=:B1 AND "OPERATOR_ID"="LIMS$OPERATOR_ID"())
34 - access("GROUP_ID"=:B1 AND "OPERATOR_ID"="LIMS$OPERATOR_ID"())
35 - access("GROUP_ID"=:B1 AND "OPERATOR_ID"="LIMS$OPERATOR_ID"())
36 - access("GROUP_ID"=:B1 AND "OPERATOR_ID"="LIMS$OPERATOR_ID"())
Note
- 'PLAN_TABLE' is old version
tkprof 2
TKPROF: Release 10.2.0.3.0 - Production on Tue Jan 13 13:28:26 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Trace file: C:\oracle\product\10.2.0\admin\nautp02\udump\nautp02_ora_5456.trc
Sort options: default
count = number of times OCI procedure was executed
cpu = cpu time in seconds executing
elapsed = elapsed time in seconds executing
disk = number of physical reads of buffers from disk
query = number of buffers gotten for consistent read
current = number of buffers gotten in current mode (usually for update)
rows = number of rows processed by the fetch or execute call
SELECT sdu.u_crop_group,
sd.name as sdg_name,
ad.variety_name,
ad.batch_number,
a.name as aliquot_name,
sau.u_box_code as box_code,
sau.u_box_position as box_position,
t.name as test_name,
r.original_result,
plt.name as plate_name,
concat(chr(a.plate_row + 64),a.plate_column) as plate_position,
au.u_replicate_number as replicate_number
FROM lims_sys.sdg sd,
lims_sys.sdg_user sdu,
lims_sys.sample sa,
lims_sys.sample_user sau,
lims_sys.aliquot a,
lims_sys.aliquot_user au,
lims_sys.test t,
lims_sys.result r,
lims_sys.plate plt,
lims_sys.abs_determination ad
WHERE sd.sdg_id = sdu.sdg_id
AND sd.sdg_id = sa.sdg_id
AND sa.sample_id = sau.sample_id
AND sau.sample_id = a.sample_id
AND a.aliquot_id = au.aliquot_id
AND au.aliquot_id = t.aliquot_id
AND t.test_id = r.test_id
AND plt.plate_id (+) = a.plate_id
AND sdu.u_abs_determination = ad.determination_assignment
AND a.status IN ('V','P','C')
AND r.name = 'End result'
AND sdu.u_client_type = 'QC'
AND sdu.u_year_of_sample_delivery = (:year)
AND sdu.u_week_of_processing = (:week)
AND decode(:cropcode,-1,'-1',sdu.u_crop_group) = decode(:cropcode,-1,'-1',:cropcode)
ORDER BY box_code, box_position, replicate_number
call count cpu elapsed disk query current rows
Parse 1 0.01 0.00 0 0 0 0
Execute 1 0.45 0.87 0 0 0 0
Fetch 1 1.00 0.99 0 221420 0 500
total 3 1.46 1.86 0 221420 0 500
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 97
Rows Row Source Operation
500 SORT ORDER BY (cr=221420 pr=0 pw=0 time=992364 us)
21311 FILTER (cr=221420 pr=0 pw=0 time=1128970 us)
21311 TABLE ACCESS BY INDEX ROWID RESULT (cr=221420 pr=0 pw=0 time=1086345 us)
42623 NESTED LOOPS (cr=217549 pr=0 pw=0 time=30006317 us)
21311 NESTED LOOPS (cr=174880 pr=0 pw=0 time=809278 us)
21311 NESTED LOOPS (cr=110117 pr=0 pw=0 time=553538 us)
21311 HASH JOIN OUTER (cr=46182 pr=0 pw=0 time=319102 us)
21311 TABLE ACCESS BY INDEX ROWID ALIQUOT (cr=45866 pr=0 pw=0 time=193037 us)
29088 NESTED LOOPS (cr=39885 pr=0 pw=0 time=320084 us)
7776 NESTED LOOPS (cr=24267 pr=0 pw=0 time=156721 us)
7776 NESTED LOOPS (cr=937 pr=0 pw=0 time=78954 us)
99 NESTED LOOPS (cr=454 pr=0 pw=0 time=3826 us)
99 NESTED LOOPS (cr=253 pr=0 pw=0 time=2833 us)
99 TABLE ACCESS FULL SDG_USER (cr=53 pr=0 pw=0 time=1531 us)
99 TABLE ACCESS BY INDEX ROWID DWH_ABS_DETERMINATION (cr=200 pr=0 pw=0 time=956 us)
99 INDEX UNIQUE SCAN PK_DWH_ABS_DETERMINATION (cr=101 pr=0 pw=0 time=438 us)(object id 46965)
99 TABLE ACCESS BY INDEX ROWID SDG (cr=201 pr=0 pw=0 time=707 us)
99 INDEX UNIQUE SCAN PK_SDG (cr=101 pr=0 pw=0 time=330 us)(object id 46071)
7776 TABLE ACCESS BY INDEX ROWID SAMPLE (cr=483 pr=0 pw=0 time=16261 us)
7776 INDEX RANGE SCAN FK_SAMPLE_SDG (cr=217 pr=0 pw=0 time=562 us)(object id 45990)
7776 TABLE ACCESS BY INDEX ROWID SAMPLE_USER (cr=23330 pr=0 pw=0 time=64710 us)
7776 INDEX UNIQUE SCAN PK_SAMPLE_USER (cr=15554 pr=0 pw=0 time=33728 us)(object id 46012)
21311 INDEX RANGE SCAN FK_ALIQUOT_SAMPLE (cr=15618 pr=0 pw=0 time=43423 us)(object id 45346)
21895 VIEW PLATE (cr=316 pr=0 pw=0 time=43833 us)
21895 FILTER (cr=316 pr=0 pw=0 time=21936 us)
21895 TABLE ACCESS FULL PLATE (cr=316 pr=0 pw=0 time=37 us)
0 INDEX UNIQUE SCAN PK_OPERATOR_GROUP (cr=0 pr=0 pw=0 time=0 us)(object id 45769)
21311 TABLE ACCESS BY INDEX ROWID ALIQUOT_USER (cr=63935 pr=0 pw=0 time=182479 us)
21311 INDEX UNIQUE SCAN PK_ALIQUOT_USER (cr=42624 pr=0 pw=0 time=99160 us)(object id 45386)
21311 TABLE ACCESS BY INDEX ROWID TEST (cr=64763 pr=0 pw=0 time=219096 us)
21311 INDEX RANGE SCAN FK_TEST_ALIQUOT (cr=42669 pr=0 pw=0 time=129354 us)(object id 46222)
21311 INDEX RANGE SCAN FK_RESULT_TEST (cr=42669 pr=0 pw=0 time=125893 us)(object id 45940)
0 INDEX UNIQUE SCAN PK_OPERATOR_GROUP (cr=0 pr=0 pw=0 time=0 us)(object id 45769)
0 INDEX UNIQUE SCAN PK_OPERATOR_GROUP (cr=0 pr=0 pw=0 time=0 us)(object id 45769)
0 INDEX UNIQUE SCAN PK_OPERATOR_GROUP (cr=0 pr=0 pw=0 time=0 us)(object id 45769)
0 INDEX UNIQUE SCAN PK_OPERATOR_GROUP (cr=0 pr=0 pw=0 time=0 us)(object id 45769)
select 'x'
from
dual
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 1 0.00 0.00 0 0 0 1
total 3 0.00 0.00 0 0 0 1
Misses in library cache during parse: 0
Optimizer mode: ALL_ROWS
Parsing user id: 97
Rows Row Source Operation
1 FAST DUAL (cr=0 pr=0 pw=0 time=6 us)
begin :id := sys.dbms_transaction.local_transaction_id; end;
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 2 0
Execute 1 0.00 0.00 0 0 0 1
Fetch 0 0.00 0.00 0 0 0 0
total 2 0.00 0.00 0 0 2 1
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 97
OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 3 0.01 0.00 0 0 2 0
Execute 3 0.45 0.87 0 0 0 1
Fetch 2 1.00 0.99 0 221420 0 501
total 8 1.46 1.87 0 221420 2 502
Misses in library cache during parse: 2
Misses in library cache during execute: 2
OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 43 0.01 0.00 0 0 12 0
Execute 128 0.00 0.01 0 0 0 0
Fetch 178 0.00 0.00 0 383 0 465
total 349 0.01 0.02 0 383 12 465
Misses in library cache during parse: 5
Misses in library cache during execute: 5
3 user SQL statements in session.
128 internal SQL statements in session.
131 SQL statements in session.
Trace file: C:\oracle\product\10.2.0\admin\nautp02\udump\nautp02_ora_5456.trc
Trace file compatibility: 10.01.00
Sort options: default
1 session in tracefile.
3 user SQL statements in trace file.
128 internal SQL statements in trace file.
131 SQL statements in trace file.
19 unique SQL statements in trace file.
1352 lines in trace file.
287 elapsed seconds in trace file. -
Why can the explain plan be different from 2 exact set of structures
hi,
i have from a view some base tables let's say A , B, C & D
this query is running very slow . so from the same database , i created tables A1 , B1, C1,& D1 from the above tables.
i created some new indexes on A1 to D1 tables and the results returned to me is fast.
i did an exlain plan
so i drop the indexes on the original A to D table and created the new indexes as per A1 to D1 and analyzed them. and i also did an explain plan
but the query is still running slow and also the explain plan is different to the one from A1 to D1 (the one that running fast)
pls help me to understand how/why can this happen ?
tks & rdgshi,
precisely i could have been providing insufficient information but i am too inexperienced to be able to give you the required information and i am also not very sure where i could get the info so that you all can advise me further.
but this is from the user_tables , the only difference i see is that
under LOGGING table A to E is 'YES'
TABLE_NAME TABLESPACE_NAME PCT_FREE LOGGING BACKED_UP NUM_ROWS BLOCKS CACHE TABLE_LOCK PARTITIONED
A1 OWNER1 10 NO N 37332 883 N ENABLED NO
B1 OWNER1 10 NO N 43458 861 N ENABLED NO
C1 OWNER1 10 NO N 823828 7826 N ENABLED NO
D1 OWNER1 10 NO N 881176 14646 N ENABLED NO
E1 OWNER1 10 NO N 18868 223 N ENABLED NO
A OWNER1 10 YES N 37040 880 N ENABLED NO
B OWNER1 10 YES N 43386 880 N ENABLED NO
C OWNER1 10 YES N 823820 7684 N ENABLED NO
D OWNER1 50 YES N 880948 26624 N ENABLED NO
E OWNER1 10 YES N 18690 244 N ENABLED NOtks & rdgs -
How to change the explain plan for currently running query?
Hi All,
I am using Oracle enterprise 9i edition. I have a query which frames dynamically and running in the database. I noticed a table with 31147758 rows
in the query which has no indexes and taking more time to process. I tried to create an INdex on that table. I know the query is already running with a FULL table scan. Is it possible to change the explain plan for the current running query to consider the INDEX?
[code]
SELECT /*+ USE_HASH (c,e,b,a) */
d.att_fcc extrt_prod_dim_id,
d.att_fcc compr_prod_dim_id,
a.glbl_uniq_id glbl_uniq_id,
to_date(c.dit_code,'RRRRMMDD')STRT_DT,
(to_date(c.dit_code,'RRRRMMDD')+150)END_DT,
a.pat_nbr pat_id,
a.rxer_id rxer_id,
e.rxer_geog_id rxer_geog_id,
a.pharmy_id pharmy_id,
a.pscr_pack_id pscr_pack_id,
a.dspnsd_pack_id dspnsd_pack_id,
DENSE_RANK () OVER (PARTITION BY a.pat_nbr ORDER BY c.dit_code) daterank,
COUNT( DISTINCT d.att_fcc ) OVER (PARTITION BY a.pat_nbr, c.dit_code) event_cnt
DENSE_RANK () OVER (PARTITION BY a.pat_nbr,
d.att_fcc
ORDER BY c.dit_code) prodrank,
DENSE_RANK () OVER (PARTITION BY a.pat_nbr,
d.att_fcc
ORDER BY c.dit_code DESC) stoprank
FROM
pd_dimitems c,
pd_pack_attribs d ,
lrx_tmp_rxer_geog e,
lrx_tmp_pat_daterank p,
lrx_tmp_valid_fact_link a
WHERE c.dit_id = a.tm_id
AND e.rxer_id = a.rxer_id
AND a.glbl_uniq_id = p.glbl_uniq_id
AND p.daterank > 1
AND a.pscr_pack_id = d.att_dit_id
[/code]
The table lrx_tmp_pat_daterank is having that 31147758 rows. So I am wondering how to make the query to use the newly created index on the table?Why do you think using Indexes will improve the performance of the query? How many rows this query is returning? Optimizer might chose a Full table scan when it finds out that Index plan might not be useful. Why are you using /*+ USE_HASH (c,e,b,a) */ hint? This Hint will force oracle to use Full table scan instead of using the index. Try removing it and see if the plan changes.
Regards,
Maybe you are looking for
-
TS1362 Has anyone found a fix for the ITunes stutter while playing songs in ITunes WinXp?
I have search for days to find a solution to this problem. As long as I'm not doing any multi-tasking the songs play ok sometimes, but do anything else and the songs stutter. I am using WinXp Pro. I tried closing all the applications running and even
-
270 dollar zen extra broken after short warranty left high and
My Zen Xtra is fi've months old I haven't dropped it and when I picked it up to use the other day it wouldn't work. It turns on and visually looks as though its playing a song but no sound comes out. The menu works until you try to do something that
-
Camera Carl Zeiss 12MP Nokia N8 doesn´t work
Hi Guys!!! I have a Problem with Nokia N8, the camera doesn´t work, I can open the camera software and runs fine, but does not display picture (black screen), it doesn´t displays imagen in video rec mode too, if I select second camera it works well.
-
I have Keynote 1.1.1, is there an upgrade I can install?
I have Keynote 1.1.1, is there an upgrade I can install? To make matters worse, some system upgrade installed a demo version of iWork. Even thought I deleted the demo version, the installers say there is no updatable Keynote file inside the folder th
-
Quiero comprar en store y me dice k el id de la cuenta no esta actualizado? que puedo hacer
quiero comprar en store y me dice k el id de la cuenta no esta actualizado? que puedo hacer