×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How to increase performance of ROW_NUMBER() OVER (PARTITION BY..) in Sql Server 2016

How to increase performance of ROW_NUMBER() OVER (PARTITION BY..) in Sql Server 2016

How to increase performance of ROW_NUMBER() OVER (PARTITION BY..) in Sql Server 2016

(OP)
Hello Every one,

I am using
(SELECT ROW_NUMBER() OVER (PARTITION BY ft.EmpID , dimdt.YEAR_NUMBER, dimdt.MONTH_OF_YEAR_NUMBER ORDER BY dimdt.Date DESC) row_number
, field1
.field2 .. ec
my ft table has millions of row. I can get the result (month end most recent records of each employee) what I want but it is very slow rather extremely slow. Is there any alternative or a way to optimize the performance?

thanks

RE: How to increase performance of ROW_NUMBER() OVER (PARTITION BY..) in Sql Server 2016

Give us
  • Full code
  • DDL for all tables involved
  • Actual Explain plan
  • Underlying Windows Server spec - cpu/mem
  • SQL Server max memory, max dop and "cost Threshold for parallelism" values
And we may be able to help you.

and exactly what is your intention - is it the most recent entry you need? latest 10? without knowing the requirements we can't help either - and do take in consideration that code alone without any explanation won't be any good.

Regards

Frederico Fonseca
SysSoft Integrated Ltd
www.syssoft-int.com

FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?

RE: How to increase performance of ROW_NUMBER() OVER (PARTITION BY..) in Sql Server 2016

(OP)
Thanks fred. Due to privacy policy , I can not share original code publicly. Is there any way to share privately?

Thanks

RE: How to increase performance of ROW_NUMBER() OVER (PARTITION BY..) in Sql Server 2016

(OP)
Hi Fred, I have sent you the information. Hope the address would be ok. Thanks

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close