---
title: "Discussion on \"Stop Guessing Between .count, .length, and .size in Rails\" | Hashnode"
description: "Discussion on \"Stop Guessing Between .count, .length, and .size in Rails\". In Rails, .count, .length, and .size all return a number but query your database very differently. Learn how each works and which to use."
url: "https://hashnode.com/posts/stop-guessing-between-count-length-and-size-in-rails/6a33da26872d99a64bf9f9a5"
---

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

Discussion

# [Stop Guessing Between .count, .length, and .size in Rails](https://pavelmyslik.hashnode.dev/stop-guessing-between-count-length-and-size-in-rails?utm_source=hashnode&utm_medium=feed)

In Rails, .count, .length, and .size all return a number but query your database very differently. Learn how each works and which to use.

Jun 18 · 4 min read · pavelmyslik.hashnode.dev  
Read the article

-   [#rails](https://hashnode.com/tag/rails)
-   [#ruby](https://hashnode.com/tag/ruby)
-   [#performance](https://hashnode.com/tag/performance)
-   [#webdev](https://hashnode.com/tag/webdev)
-   [#backend](https://hashnode.com/tag/backend)

## Written by

[Pavel Myslik](https://hashnode.com/@myslikp)

@myslikp

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

Ruby / Rails developer focused on writing clear and maintainable code.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
