Help in Performance Improvement of a Data Function.

Who is online?  100 guests and 0 members
home  »  forums   »  microsoft data platform   »  sql server & bi   » Help in Performance Improvement of a Data Function.

Help in Performance Improvement of a Data Function.

Topic RSS Feed

Posts under the topic: Help in Performance Improvement of a Data Function.

Posted: 6/28/2012 7:03:26 AM

Lurker 167  points  Lurker
  • Joined on: 11/9/2011 3:55:30 PM
  • Posts: 6

Friends,

I am having a serious performance problem with the below query:

SELECT     DATEADD(mi, (SELECT     BiasInMinutes FROM  A WHERE   (Begin1 < B.CompletedWhen) AND (End1 >= B.CompletedWhen) AND   (Timezone = C.TimeZone_I)), B.CompletedWhen) AS Expr1) BETWEEN'2012-05-19' + ' 00:00' AND '2012-06-05' + ' 23:59'

The query executes for 3 minutes to fetch the data for 1 months,4 minutes for 2 months and around more than 15 minutes for more than a year.

I have indexes on the date colums but still performance is very poor.

Any idea on this?

 

 

 


Posted: 6/28/2012 7:47:38 AM

Lurker 18  points  Lurker
  • Joined on: 3/16/2011 6:56:21 AM
  • Posts: 4

Is that the complete query, where are the joins for B and C? Without knowing the structure of tables A, B and C it is not possible to give you an optimized query.

Can you not simply use  BETWEEN '2012-05-19 00:00' AND '2012-06-05 23:59' instead of using concatenation?


Posted: 6/28/2012 7:57:12 AM

Lurker 29  points  Lurker
  • Joined on: 3/15/2011 8:59:00 AM
  • Posts: 12

can you please provide table structure.. no of records and indexes created both Clustered and Non-Clustered, i will try to provide a quick fix.


Posted: 6/28/2012 8:05:57 AM

Lurker 167  points  Lurker
  • Joined on: 11/9/2011 3:55:30 PM
  • Posts: 6

Can I have your email address please, I cant post the original query due to restrictions.


Posted: 6/28/2012 8:09:43 AM

Lurker 29  points  Lurker
  • Joined on: 3/15/2011 8:59:00 AM
  • Posts: 12

navratan.verma@gmail.com,


Posted: 6/28/2012 12:05:28 PM

Lurker 18  points  Lurker
  • Joined on: 3/16/2011 6:56:21 AM
  • Posts: 4

senthilks@gmail.com, in case you want to send it to me.


Posted: 7/6/2012 12:13:35 PM

Lurker 69  points  Lurker
  • Joined on: 6/4/2011 11:39:17 AM
  • Posts: 12

Hi Satnam & Navratan,

If this issue is solved please you both share this problem & it's solution with US.

That will be a good  task to learn for our  team.

 

 


Posted: 7/6/2012 12:55:42 PM

Lurker 167  points  Lurker
  • Joined on: 11/9/2011 3:55:30 PM
  • Posts: 6

I have fixed this out such that there is more than 100% improvement in the performance of the query. I am actually writing an article on the same subject but will take atleast 2 weeks time for it to get released.

Thank you.


Page 1 of 1 (8 items)