I am trying to Select the latest SalesLine with a specific serial number. Here is my query:
Select FirstOnly SalesLine Order By SalesLine.createdDateTime Desc
Exists Join InventDim Where InventDim.inventDimId == SalesLine.InventDimId
&& InventDim.inventSerialId == "Serial Number";
It is very slow, and I need a way to increase speed. Should I add indexes on InventDim.InventSerialId and SalesLine.InventDim?
Thanks.
*This post is locked for comments
Bingo. I don't know why I didn't order by recId to begin with. Thanks!
Thanks Sukrut,
There may be multiple sales Lines with the same serial (I know this isn't normal, but its possible in our scenario). So, I need the latest salesLine, hence the order by. I am using the exists join, because I only need the SalesLine info, not the invent dim Info. I thought that would be faster.
Actually, it looks like both those indexes exist already...
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156