dbTalk Databases Forums  

Performance Tuning

sybase.public.ase.performance+tuning sybase.public.ase.performance+tuning


Discuss Performance Tuning in the sybase.public.ase.performance+tuning forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
guru4dw@gmail.com
 
Posts: n/a

Default Performance Tuning - 06-20-2012 , 08:02 AM






Hi,


Question:

When I run the query in stored procedure, it takes 7 minutes
When I run the query in ASE open window, it takes 10 seconds

What is the reason, and please help me to understand.

Query:

INSERT INTO A
Select
.....
.....
FROM A
JOIN B
WHERE A.ID = B.ID

I have index on both tables.
Table A- Clustered Index
Table B- Non-Clustered Index


Table A contains 60,000 rows
Table B contains 2 crores of rows
Final output: 1,50,000 rows

Reply With Quote
  #2  
Old   
Milo Minderbinder
 
Posts: n/a

Default Re: Performance Tuning - 10-02-2012 , 06:02 PM






Am 20.06.2012 15:02, schrieb guru4dw (AT) gmail (DOT) com:
Quote:
Hi,


Question:

When I run the query in stored procedure, it takes 7 minutes
When I run the query in ASE open window, it takes 10 seconds

What is the reason, and please help me to understand.

Query:

INSERT INTO A
Select
....
....
FROM A
JOIN B
WHERE A.ID = B.ID

I have index on both tables.
Table A- Clustered Index
Table B- Non-Clustered Index


Table A contains 60,000 rows
Table B contains 2 crores of rows
Final output: 1,50,000 rows

I'm not surprised about this behavior. Take a look at the plans. I guess
they differ. Create the procedure "with recompile". If your in luck, the
optimizer will bless your procedure (sometimes) with a useful plan.
Milo

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.