# query and save / select \* vs filter

**URL:** <https://forum.djangoproject.com/t/query-and-save-select-vs-filter/22599>\
**Category:** Getting Started\
**Created:** [July 28, 2023, 7:51am UTC](https://forum.djangoproject.com/t/query-and-save-select-vs-filter/22599 "2023-07-28T07:51:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Galigao07](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/galigao07/32/14574_2.png) [@Galigao07](https://forum.djangoproject.com/u/Galigao07)\
**Post date:** [July 28, 2023, 7:51am UTC](https://forum.djangoproject.com/t/query-and-save-select-vs-filter/22599/1 "2023-07-28T07:51:48Z")

</div>

its ok to use select \* query when using django ? if not what is the downside? what is the difference? thank you and God Bless…

---

<div class="post-metadata">

**Author:** ![addwebsolution](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/addwebsolution/32/23762_2.png) [@addwebsolution](https://forum.djangoproject.com/u/addwebsolution)\
**Post date:** [July 28, 2023, 8:04am UTC](https://forum.djangoproject.com/t/query-and-save-select-vs-filter/22599/2 "2023-07-28T08:04:33Z")

</div>

> [@Galigao07](#):
>
> its ok to use select \* query when using django

Yes, it is ok to use raw SQL query if you prefer to, either you can use `ModelName.objects.all()` which actually a select \* query.

> [@Galigao07](#):
>
> if not what is the downside? what is the difference?

For this part of your questions, you have to specify the context clearly like difference between what? what kind of downside you are asking in compared too?

---

<div class="post-metadata">

**Author:** ![JaK](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/jak/32/14954_2.png) [@JaK](https://forum.djangoproject.com/u/JaK)\
**Post date:** [July 28, 2023, 5:40pm UTC](https://forum.djangoproject.com/t/query-and-save-select-vs-filter/22599/3 "2023-07-28T17:40:20Z")

</div>

I’d actually argue that using raw sql in django is not something which is up to preference. Its more of a last resort if you have something incredibly specific with some database type which cannot be done using django’s orm.

Django has a phenomenal orm, learn to use it, you wont ever look back.

But to get back on topic:  
Using a queryset which practially does a select \* - or any select which may return a lot of rows is fine. You can solve potential scaling issues by paginating your return set.

Docs for pagination: [Pagination | Django documentation | Django](https://docs.djangoproject.com/en/4.2/topics/pagination/)
