0
votes

Setup:

I have two lists on a SharePoint site, A and B. List A has a column 'b' that is a lookup to the ID field of list B. I have 500k+ records in A and about 6k records in B.

What works:

I am able to execute a query for items in list A using SharePoint web services, and am even able to filter the query based on a specific "lookup" value for column 'b'. For example, I can query for items in A whose column b matches 1234 (...<Value Type="Lookup">1234</Value>...), and so on.

What doesn't work:

The query does not work for items older than a specific date, even though my query does not involve dates in any way -- only the lookup column. Any query on data newer than two years old works fine, anything older than that fails. If I view items from the SharePoint web page they appear ok, and all the links from child records in B to parent records in A work just fine -- the lookup columns appear intact.

Question:

Is there some kind of maintenance task in SharePoint that can cause some underlying data to get corrupted that can prevent a query based on a lookup id to stop working, like a system restore, etc? In other words, the lookup column data appears correct on the surface in the web browser. But does SharePoint represent this value with a GUID or other invisible data that might be out of sync or stale?

Thanks.

3
Starting to this this issue is related: blog.qumsieh.ca/2009/05/12/….Dan
Perhaps the day I changed that column from non-indexed to indexed is the day everything went to hell.Dan

3 Answers

1
votes

Maybe you are hitting another limit; the maximum number of items retrieved in a query?

See list throttling

0
votes

Try querying by the ID by adding the LookupId=”TRUE” attribute to your FieldRef element. http://abstractspaces.wordpress.com/2008/05/05/caml-query-lookup-field-by-id-not-by-value/

0
votes

The problem appears to be related to the fact that the column in question was indexed. When I removed the index everything started working. When I reapplied the index, everything kept on working. I'm attributing this problem to a corrupt index.