This is something that should be part of your SQL maintenance already, but if it isnāt please do yourself a favor and update statistics on your Db at least once or twice a month (more often if you have a really heavy usage)
We just spent 2 hours chasing an incredibly slow BAQ which was returning < 300 records and taking an inordinate amount of time to run.
We were using a new UD table for the first time in this BAQ and after much todo, we neded up generating an execution plan for our BAQ using SQL Server Profiler
This yielded a clean execution plan however a āfewā warnings we noted on there said āWarning Columns with No Statisticsā
Also if you are using the SQL Server Index and Statistics Maintenance scripts it may not be doing a full scan. I assumed these are updating my statistics, but iām having the slow BAQ issues too. Still need to determine if running it manually fixes that.
There were only 300 rows in the UD table
And I did run the query manually and it did take forever until we updated statistics
( I ran the same exact query as Epicor by capturing the query run using sql profiler)
When I say forever I mean 25 seconds for a 300 row table
After stats update it ran in less than 1 second (registered as 0 in Mssql studio)