Somewhat off-topic, but I thought I might mention: I wrote a very similar tool (extract random sample of features) a little while ago, and found that it was breaking when the sample size was >~10,000. I was constructing the SQL statement string to pass to the Select tool something along the lines of " OR ".join(["'{0}' = {1}".format(oid_fname,x) for x in random_fids])
And this string of OR statements was falling over. I had to change it to use the IN statement for it to work, i.e."'{0}' IN ({1})".format(oid_fname,",".join(random_fids))
(Note I haven't double-checked that syntax, but hopefully you get the idea).In other words: chaining multiple OR statements made the arcpy.Select() tool fail, using the IN SQL statement worked on >50,000 records.Just to save you some pain 🙂