So I have a SP list with about 100k items (voucher codes) in it. Each of them has columns for State (Active/Used), Value (10,20,30) Group (Normal, Special) and Code (random alphanumeric). Each of the columns are indexed
I can't use CAML to get the next active code for a certain group and value, because each of the criteria would return > 5k items (list view threshold).
So what would be the most efficient way to retrieve the next code? As the list is continuously growing, loading all items with SPListItemCollectionPosition is not really an option. Isn't there a better way? It should work for onprem, as well as spOnline
Thank you