question

Mahesh120718 avatar image
Mahesh120718 asked

Sql server 2017 performance

I have a query which works well in sql server 2014 filetables , after sql server 2017 upgrade it performs worse.

Query Prototype:

select cached_file_size from filetable where streamid='88656899'

Union

Select cached_file_size from filetablehistory where streamid='88656899'

Below Observations working fine:

1.

select cached_file_size from filetable where streamid='88656899'

Union all

Select cached_file_size from filetablehistory where streamid='88656899'

2.

select cached_file_size from filetable where streamid='88656899'

3.

Select cached_file_size from filetablehistory where streamid='88656899'

4. There are no locks held on those tables.

Please help!!

sql server 2017
6 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

KenJ avatar image KenJ commented ·

Is this on the same server that was upgraded in place or was the database restored to a different server that is sql 2017?

Is the database compatibility set for 2014 or 2017?

Did you run dbcc updateusage on the database after the upgrade?

Can you post the query plan for one of these queries?

0 Likes 0 ·
Mahesh120718 avatar image Mahesh120718 KenJ commented ·

hello kenj

The database is restored from 2014 to 2017.

This is working fine some times and sometimes its taking time. Tried changing database properties of legacy cardinality to on also but was vain.

Once i run dbcc update statistics it works fine without issue and problem repeats again after a couple of days

Also found some procedures are running too slow but underlying query is executing fast

0 Likes 0 ·
KenJ avatar image KenJ Mahesh120718 commented ·

Any chance the old server had an index or statistics job that kept the stats up to date but the new server doesn’t ? It’s common practice to create jobs to automate the maintenance of indexes and statistics.

0 Likes 0 ·
Show more comments

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.