paint-brush
Differences Between Includes and Joins in Ruby on Railsby@ashubhosale
18,260 reads
18,260 reads

Differences Between Includes and Joins in Ruby on Rails

by ashubhosale2mJune 7th, 2021
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow
EN

Too Long; Didn't Read

Many of us know about includes, joins but sometimes we confuse about their usage. As I was experimenting with code refactoring in one of my projects, there I have tried these things. As we know includes and join are used when we are performing operations on associated tables. Both are used for the same purpose. When we want to fetch data along with an associated table then includes must be used.Joins: Uses lazy loading. Includes: Uses eager loading, When. We can use joins when we. want to consider the data as a condition from the joined table.

Company Mentioned

Mention Thumbnail
featured image - Differences Between Includes and Joins in Ruby on Rails
ashubhosale HackerNoon profile picture
ashubhosale

ashubhosale

@ashubhosale

I am here to write about my experiences and how I learnt from my experiences.

Learn More
LEARN MORE ABOUT @ASHUBHOSALE'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

ashubhosale HackerNoon profile picture
ashubhosale@ashubhosale
I am here to write about my experiences and how I learnt from my experiences.

TOPICS

Languages

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite