# retrieving 1000s of rows performace

**URL:** <https://forum.djangoproject.com/t/retrieving-1000s-of-rows-performace/11849>\
**Category:** Forms & APIs\
**Created:** [January 28, 2022, 10:48am UTC](https://forum.djangoproject.com/t/retrieving-1000s-of-rows-performace/11849 "2022-01-28T10:48:51Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [January 31, 2022, 2:30pm UTC](https://forum.djangoproject.com/t/retrieving-1000s-of-rows-performace/11849/15 "2022-01-31T14:30:09Z")

</div>

Confirming - then there is a connection between this topic and [Loop through queryset and store data](https://forum.djangoproject.com/t/loop-through-queryset-and-store-data/11763)?

Are you making an individual API call for each product? If so, and you’re talking about 1000+ rows, then **nothing** is going to significantly speed this up.

Or, are you retrieving all current prices for all products in one call? If so, then what you’ve got is a “matching” situation. (Match items from list of ObjectA with items in list of ObjectB)

Regarding working with CBVs, see my response at [Loop through queryset and store data](https://forum.djangoproject.com/t/loop-through-queryset-and-store-data/11763). There is a bit of a learning curve with them - they do require some comfort with class inheritance in Python to really understand how they work and to fully take advantage of them.

> [@TommyQuality](#):
>
> And how do I know what data is being displayed in order to pass in the product symbol to get the price.

You’re going to need to start understanding CBVs before I can even begin to address this properly. Briefly, there’s a function in the class called `get_context_data` that is responsible for pulling all the data together to be rendered by the view. You will end up overriding that method and doing additional work on that context. (And if that sentence doesn’t make any sense yet, that’s ok - it will.)

---

_[View the full topic](https://forum.djangoproject.com/t/retrieving-1000s-of-rows-performace/11849)._
