Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics RMS (Archived)

Opening POS/SO/HQ Manager Query

(0) ShareShare
ReportReport
Posted on by

Hi All, 

  How can we go about requesting a change (if possible) for the T-SQL executed against the database when opening items in POS/SO and HQ Manager?   

  I can post the code for each later but HQ and SO Manager take around 14+ seconds to execute locally.  It seems as if the queries execute 4 times and I don't understand why they need to do this?  

  We currently have 40-50 users hitting one database server that houses HQ and one Store Database.  Refining or tuning the queries would help us get out of our current predicament as we are having slowdowns and locking occur.

  Users constantly complain that RMS is slow and they are suddenly kicked out of the program.   We run 1Gbps network and our 2012 Sql Database Server VM runs with Quad 3.2GHZ, 24GB of DDR3 and uses a Fusion IO solid state drive.  We are not I/O pegged but RMS just seems to run terribly due to the queries for the Item table.   We currently have 200,000 items and growing.

  Any advice would be great!

*This post is locked for comments

  • Community Member Profile Picture
    on at
    RE: Opening POS/SO/HQ Manager Query

     I have a nightly maintenance plan that runs and rebuilds indexes to prevent fragmentation.

  • Community Member Profile Picture
    on at
    RE: Opening POS/SO/HQ Manager Query

     Here are the queries that I picked up with SQL Profiler that are running when opening SO Manager and clicking the item Tab:

      SELECT ID, ItemLookUpCode, ItemType as ItemTypeText,      Description, AvailableQuantity = Quantity - QuantityCommitted,      Price, PictureName FROM Item Where Inactive = 0 UNION

        SELECT ID, ItemLookUpCode,      CASE ClassType WHEN 0 THEN 2 WHEN 1 THEN 8 WHEN 2 THEN 4 END,      Description, null, null, ''  FROM ItemClass WITH(NOLOCK)  ORDER BY ItemLookupCode

    GO

    SELECT ID, ItemLookUpCode, ItemType as ItemTypeText,      Description,CASE Inactive WHEN 0 THEN 'Active' ELSE 'Inactive' END As Status, AvailableQuantity = Quantity - QuantityCommitted,      Price, PictureName FROM Item  WHERE Inactive = 0 UNION

        SELECT ID, ItemLookUpCode,      CASE ClassType WHEN 0 THEN 2 WHEN 1 THEN 8 WHEN 2 THEN 4 END,      Description,null, null, null, '' FROM ItemClass WITH(NOLOCK) ORDER BY ItemLookupCode

    GO

    SELECT Item.ID,  ItemLookUpCode,ItemType as ItemTypeText,      Supplierlist.reordernumber, Item.description,AvailableQuantity = Quantity - QuantityCommitted,      SupplierList.Cost,Item.SupplierID as PrimarySupplierID,SupplierList.SupplierID FROM Item left join supplierlist on Item.ID = Supplierlist.ItemID

    WHERE Inactive = 0

    UNION

    SELECT ID, ItemLookUpCode,   CASE ClassType WHEN 0 THEN 2 WHEN 1 THEN 8 WHEN 2 THEN 4 END,   null,Description, null, null,null,SupplierID FROM ItemClass WITH(NOLOCK) ORDER BY ItemLookupCode

         GO

    SELECT ID, ItemLookUpCode, ItemType as ItemTypeText,      Description,CASE Inactive WHEN 0 THEN 'Active' ELSE 'Inactive' END As Status, AvailableQuantity = Quantity - QuantityCommitted,      Price, PictureName FROM Item  UNION

        SELECT ID, ItemLookUpCode,      CASE ClassType WHEN 0 THEN 2 WHEN 1 THEN 8 WHEN 2 THEN 4 END,      Description,null, null, null, '' FROM ItemClass WITH(NOLOCK) ORDER BY ItemLookupCode

  • Suggested answer
    Umesh Pandit Profile Picture
    9,303 User Group Leader on at
    RE: Opening POS/SO/HQ Manager Query

    Hi Chazh,

    If you are using SQL 2012, then less indexing will help you out. Since in SQL 2008 r2 Indexing was recommended for the faster processing for the date, but in SQL 2012 is not like data.Get your code reviewed.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,161 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,942 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans