Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Queryset v/s List Django

I want to know what is the difference in terms of execution in Django queryset and Django list.

For eg, List of Objects v/s Queryset of Objects

Will there be much difference in the execution part?

Any Info will help as It can give a clear picture what to use and what not to use.

Thanks!

like image 473
Harshit verma Avatar asked Apr 30 '26 21:04

Harshit verma


1 Answers

List of Objects is evaluated, Queryset isn't unless you perform any computation on the data.

List of Objects will consume RAM space, Queryset won't that much.

You can refer Queryset further in the code without actually dealing with data in your memory, list of objects won't allow you to manipulate data that easily.

This is what I think, others can add to it.

like image 128
Nayan Goenka Avatar answered May 02 '26 09:05

Nayan Goenka



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!