SQLSERVER reports SLOW on Replication database

Paul Seeberg 21 Reputation points
2021-08-24T18:00:13.277+00:00

Our environment is 2 sqlserver 2017 databases on 2 different but identically set up servers (VM) , using transactional replication between them.

The replication process is working great. Great performance. NO complaints on the replication.

The issue is the reports. We have some complicated reports, that run well on the publisher (seconds) but take a LONNNNG time on the subscriber (6+ minutes) .

What I did first:

stopped the replication. retried the reports, No performance difference.

I then tried:
deleted the subscriber database, restored the production db onto the other server (that was the subscriber) , so it is no longer a subscriber, just a copy of the production database, and the reports ran like they did on the publisher .

we determined the slowness was due to the database being in replicated mode vs standalone database.

What could be causing the reports to run slow when database is in replication mode but run fine when the database is a regular database (no replication) . Any settings or other ideas to check ?

Any thoughts??

Thanks!

SQL Server Other
0 comments No comments
{count} votes

Accepted answer
  1. Tom Phillips 17,771 Reputation points
    2021-08-24T18:51:03.877+00:00

    As a default non-clustered indexes are not transferred via replication. The subscriber can have different indexes defined to support different uses, like reporting. The reason your backup/restore worked is likely because you transferred all the indexes.

    The fact database being replicated does not have anything to do with your performance. Replication does not affect the performance of the subscriber.


1 additional answer

Sort by: Most helpful
  1. Seeya Xi-MSFT 16,586 Reputation points
    2021-08-25T09:10:45.433+00:00

    Hi @Paul Seeberg ,

    Agree with Tom.
    You can try Tom's method. If it doesn't work, please feel free to let us know.

    Best regards,
    Seeya

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.