July 29, 2019 at 1:26 pm
yes its fast if i restore it on the fast instance
July 29, 2019 at 1:28 pm
but have you restored it on the slow instance? Try restoring it on the slow instance. Restore it using a different database name if you need to and try again with the select.
July 29, 2019 at 1:28 pm
yes took a backup and restored on the slow instance still slow
July 29, 2019 at 1:30 pm
where are you running the select from?
July 29, 2019 at 1:31 pm
So, the differences in index size and free space there suggests that the two databases are not identical. Was an index rebuild run on one of them and not the other? Stuff like this could lead to differences in behavior.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
July 29, 2019 at 1:33 pm
Management Studio
July 29, 2019 at 1:33 pm
I suspect also fragmented db file or disk block size - more I/O to do to get the same data?
July 29, 2019 at 1:35 pm
Management Studio on your client workstation or do you RDP on to each server? Could it be network? Try doing a "select * into another_table from table" or a temp table on both instances.....
July 29, 2019 at 1:51 pm
Please, capture the wait statistics for the query on both fast and slow instances. Just running SELECT * over and over isn't going to tell us much unless we gather information. Get the I/O too.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
July 30, 2019 at 8:22 am
i think i might have found something:
PAGEIOLATCH:
slow instace/db = waitcount 1620
waittime ms 282476
fast instance/db = waitcount 257
waittime ms 85164
July 30, 2019 at 10:51 am
That suggests a strong and distinct difference in I/O behavior. Are the different databases on the different instances on different disks?
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
August 2, 2019 at 4:27 am
Please try running update stats on the table with the recompile option on the slow DB and run the query again.
August 2, 2019 at 11:15 am
Please try running update stats on the table with the recompile option on the slow DB and run the query again.
Sorry, I'm confused. "update stats on the table with the recompile option"? Update stats doesn't have a recompile option. Updating the stats will cause recompiles as queries get called after the update. You wouldn't need to hint the query to recompile. I'm just confused by what you're telling the OP to do here. Could you clarify?
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
August 4, 2019 at 11:11 am
Sorry, after reading it again , I might have confused the OP more.
Correction - .. Please try to re-run the select statement again but with adding the option (recompile) in the end of the query.
Viewing 15 posts - 16 through 29 (of 29 total)
You must be logged in to reply to this topic. Login to reply