Ordering of Search (keyword & semantic) and Metadata Filter

The screenshot below from the Hybrid Search video in the Retrieval Augmented Generation course shows that the metadata filter is applied on the results of the two search methods. Since the searches are much more computationally expensive than applying a rule based metadata filter, why is the search not done only on prefiltered documents? I assume the filter criteria is not in any way dependent on the search results. Am I missing something?

You are totally right and your intuition is spot on.

Pre filtering is definitely better for performance since it narrows down the search space early on as you see The course shows post-filtering mainly because some old vector databases struggled to sync metadata with vector search in one go, or to avoid losing some context that might have messy metadata but high semantic value But in real world production i see everyone goes with pre filtering for the exact reasons you mentioned.

you can check these out for more details:

Keep it up really good catch.