A frequent question we get is how to optimize a query when a simple query to get orders has a cost of over 10,000. The reason for that is the lack of a limit which causes the cost analyzer to default to 100. So a query …