Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6966605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:12:48+00:00 2026-05-27T16:12:48+00:00

I came from non-computer-science background and Now I am working as a Ruby on

  • 0

I came from non-computer-science background and Now I am working as a Ruby on rails developer who using active_record to fetch values from database.While I reading rails scalability issues, many places I found 'N query' 'N + 1 queries' 'N log N' which I am not familiar with.I want you people to help me by explaining what all these and where I could get a nice blog or website which explaining all these terms.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T16:12:49+00:00Added an answer on May 27, 2026 at 4:12 pm

    There are 2 separate things here:

    1. N log N, N^2 etc. These refer to the running time of an algorithm as a function of the size of its input
    2. The term N + 1 queries refers to a very specific issue. Assume that you have your standard blogging example app, with Post and Author as models. I might choose to collect all the names of the authors who have actually written something:

      names = Post.all.collect { |post| post.author.name}

    This triggers one extra SQL query for each post, so if you had N posts then you’d end up doing N+1 queries. All those extra ones would be very fast query but the overhead/latency adds up quickly so it can slow stuff right down

    The Rails active record guide explains this and the mitigations rails makes available.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I came from Java, and now I am working more with Ruby. One language
Background I came from several years working in a company where all the database
I came from PHP language(codeigniter), but now I learning ASP.Net MVC :) In PHP
I came from a Windows background whern it comes to development environments. I'm used
I came from the Spring camp , I don't want to use Spring ,
There's this already populated database which came from another dev. I'm not sure what
I have a form with a hidden Came from Adwords field that will be
let me tell you a bit about where this question came from. I have
I'm trying to save the site that a user came from when they sign
How can I detect the site the user came from before accessing mine in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.