# Do a search for... vs Advanced Filters

**URL:** <https://forum.bubble.io/t/do-a-search-for-vs-advanced-filters/99407>\
**Category:** Questions\
**Created:** [June 28, 2020, 11:34pm UTC](https://forum.bubble.io/t/do-a-search-for-vs-advanced-filters/99407 "2020-06-28T23:34:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnny](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/johnny/32/203020_2.png) [@johnny](https://forum.bubble.io/u/johnny)\
**Post date:** [June 28, 2020, 11:34pm UTC](https://forum.bubble.io/t/do-a-search-for-vs-advanced-filters/99407/1 "2020-06-28T23:34:16Z")

</div>

Hey Bubblers!

I hope you are all having a great weekend!

I was wondering if someone could answer my question regarding if Doing a search for a long list of data would be faster and less performance heavy or if doing a search within some data with an advanced filter would be better. I will give an example.

For example, let’s say I have 100,000 blog posts or something similar stored in a type called “Blog” then have a field inside of that called “User” with the type user and another field called “Active”. In addition, I also have a field inside the user called, “Written Blog Posts” which is a list of “Blog.”

Would doing a search for “Blog” with constraints on a user’s active blog posts be faster or would be grabbing the list of blog active blog posts from the user type be faster with an advanced filter?

If this didn’t really make any sense please feel free to reply for clarification:)

Thanks ahead of this!

---

<div class="post-metadata">

**Author:** ![keith](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/keith/32/56020_2.png) [@keith](https://forum.bubble.io/u/keith)\
**Post date:** [June 29, 2020, 12:32am UTC](https://forum.bubble.io/t/do-a-search-for-vs-advanced-filters/99407/2 "2020-06-29T00:32:55Z")

</div>

It is _always_ faster to do any filtering _that you can_ on the server side.

Ultimately, you may not be able to get your desired, fully filtered list that way. But do as much filtering in the Search as possible and then do any required Advanced filtering on that as-small-as-possible list.

I present a real-world performance comparison of doing things the smart way vs. doing things the slow way here (the topic in question asks about :merge vs :filter, but I’m sure you’ll see how this applies in a great many other situations – read the whole thread for context):

> [@How to set OR not AND in a repeating group search](http://forum.bubble.io/t/how-to-set-or-not-and-in-a-repeating-group-search/78485/9):
>
> As you know, multiple constraints in a Search are logically ANDed together. There are multiple ways to accomplish OR constraints: While what others say above is true – you can do a :filter operation with the Advanced condition (which is one of the few iteration techniques we have in vanilla Bubble) – note that the use of the Advanced condition results in us fetching the entire list in order to process it. (For non-advanced filters, it looks like Bubble understands that the search constraint c…

---

<div class="post-metadata">

**Author:** ![johnny](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/johnny/32/203020_2.png) [@johnny](https://forum.bubble.io/u/johnny)\
**Post date:** [June 29, 2020, 1:01am UTC](https://forum.bubble.io/t/do-a-search-for-vs-advanced-filters/99407/3 "2020-06-29T01:01:12Z")

</div>

Just to clarify, are you saying that if I use the Do a search for… with constraints it would be faster than if I do :filter?

It’s hard to explain, so if I had a data type with a lot of entries and started to also save them under a user, would it be faster to just search for the big data type with constraints or searching the data in the user with filters?

---

<div class="post-metadata">

**Author:** ![keith](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/keith/32/56020_2.png) [@keith](https://forum.bubble.io/u/keith)\
**Post date:** [June 29, 2020, 2:29am UTC](https://forum.bubble.io/t/do-a-search-for-vs-advanced-filters/99407/4 "2020-06-29T02:29:27Z")

</div>

So, if you look at the post I linked to, the point is that you always want to prune the list you are sending down to the browser as much as possible.

Don’t just grab ALL the Things. Grab only the list of Things that could possibly pass the Advanced filter you’re going to do later. That is, optimize your search to include only those items that you don’t already know will be excluded later.

Only you can know what criteria you might use for this.

But as you suggest: You have a “Blog” data type and on that there’s a concept of “active”. If you’ve set up your database correctly, you can simply:

`Do a Search for... Blog (constraints: Created by {User in Question}, Active = yes)`

As I said, this will _always_ be faster than downloading all “Blog” items and filtering in the browser.

The issue being: What if your database has 100,000 Blog items? Well, first, you’ll never be able to download all of those the browser (Bubble will not allow that). But even then, if you say, “Well, I’m not dumb, of course I’m going to limit my Search to only those Blogs created by some specific User”, taking that list and then :filtering in the browser (for only those Blogs that are “active” – whatever that means) will be slower than if you can limit the Search to only return the “active” blogs.

NOW, if you’ve got your database set up in such a way that you _cannot_ construct the Search criteria for “active” blog then you might want to consider setting up so that you _can_, if this is something that you’re going to commonly do.

But I’m guessing that your Blog data type is set up just fine and your question is academic. If so, just know that what I’m saying is 100% correct. You can test it if you want, but what you’ll have to do is construct a database with a bunch of phony blog posts. (You can do that with List Shifter and some patience, but there’s no need. Limiting the number of returned items at the Search step is _always_ faster than downloading a larger number of search items and filtering in the browser… at least for any scenario where the difference in these two approaches is measurable.)

---

<div class="post-metadata">

**Author:** ![johnny](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/johnny/32/203020_2.png) [@johnny](https://forum.bubble.io/u/johnny)\
**Post date:** [June 29, 2020, 2:42am UTC](https://forum.bubble.io/t/do-a-search-for-vs-advanced-filters/99407/5 "2020-06-29T02:42:00Z")

</div>

Thank you for your response. So long story short, just try to narrow and prune out what I’m looking for then filter the specific items out.
