Sitecore query helps to retrieve data from database, Sitecore Query is not good for large number of data. And we can control max number of result return from Sitecore Query by giving value to Query.MaxItems element under ~/configuration/sitecore/settings/setting/web.config