I have a view that is basically a UNION query on Great Plains data. The data I need to pull can be stored in any of 4 different header tables (each with an associated detail table), hence the view to pull them together. When I pull data from the view, the WHERE clause looks like:
WHERE AR.Line1Date Between @FmDate And @ToDate AND
AR.Company = @CoCode AND
AR.CustomerAccount BETWEEN @FmCust AND @ToCust
I'm not normally the one to do this type of thing, so I'm unclear whether 3 indexes on the 3 fields or a single index on the combination (is that a clustered index?) would be best. Any pointers would be appreciated.