I'm running a pretty simple query to get back items using List.GetItems and it seems to be performing horribly on some of my sites (differing site collections). The lists being queried are essentially the same except for actual content. The number of items in the lists are about the same and the items that should be returned are about the same. Something to note, while there are 20k or so queries per site, the results are actually always the same, no item is returned- so there is no additional processing in this code, only the querying -- so what's being returned from the query isn't relevant I think.
In some sites it performs about 20,000 queries on a list in 1-2 minutes while in others it takes about 30 minutes. I created a powershell script that performs this functionality for logging and testing and I get the same performance results.
I am leaning towards this being a site related issue, i.e. a permission issue or something like that.
What kind of logging in powershell would be suggested to help figure out why site X is taking 30 minutes?
IIRC with SPServices, when you get items from a list there is a dependency on the default view. If you are expecting FIELD_X to be returned and FIELD_X isn't in the default view, it isn't returned etc. Similar issues could come from foldering, grouping, etc. Is this something that is also of concern with SP OM querying that is resulting in performance variances?