---
title: "Discussion on \"ActiveRecord, over-optimization and POLS\" | Hashnode"
description: "Discussion on \"ActiveRecord, over-optimization and POLS\". I recently learned that ActiveRecord implements an \"interesting\" optimization. When you pass a condition to where that could not ever be satisfied, mostly by passing an empty array, it skips the database call completely, returning empty result set. A..."
url: "https://hashnode.com/posts/activerecord-over-optimization-and-pols/62e26b4cd7b405bea15575fe"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [ActiveRecord, over-optimization and POLS](https://solid-dry-kiss.hashnode.dev/activerecord-over-optimization-and-pols?utm_source=hashnode&utm_medium=feed)

I recently learned that ActiveRecord implements an "interesting" optimization. When you pass a condition to where that could not ever be satisfied, mostly by passing an empty array, it skips the database call completely, returning empty result set. A...

Jul 28, 2022 · 4 min read · solid-dry-kiss.hashnode.dev  
Read the article

-   [#ruby-on-rails](https://hashnode.com/tag/ruby-on-rails)
-   [#ruby](https://hashnode.com/tag/ruby)
-   [#optimization](https://hashnode.com/tag/optimization)
-   [#pols](https://hashnode.com/tag/pols)

## Written by

[Paweł Świątkowski](https://hashnode.com/@katafrakt)

@katafrakt · Wrocław, Poland

  
[View profile](https://hashnode.com/@katafrakt)

Elixir developer with Ruby past

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
