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

  • SEARCH
  • Home
  • 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 4095154
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T19:51:10+00:00 2026-05-20T19:51:10+00:00

Lets say. If i have 1,000,000 users registered on my system and I have

  • 0

Lets say. If i have 1,000,000 users registered on my system and I have a list of 500 names.

I would like to crosscheck these names against the number of users on my system to see which names / users are already registered on the db.

Will such a process slow down the app significantly? Or does this sort of thing happen all the time?

Perhaps I can cache the results every 30 mins so I don’t have to call it every time.

EDIT >> A bit of clarification:

I forgot to mention that I am trying to udate the list of 500 names. So if ‘foobar’ and ‘joe’ is on this list and is also registered in the db, then all I want to do is remove ‘foobar’ and ‘joe’ from the list, giving me 498 names.

I don’t think it would be suitable to do something like:

User.where('name in (?)', Array('foobar', 'joe'))

I would have do something like:

User.each do |registered_user|
  index = list.index(list.find{ |user| user.screen_name.downcase == registered_user.screen_name.downcase })
  list.delete_at(index) if index
end

filtered_list = list

Is above code, overkill?

  • 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-20T19:51:11+00:00Added an answer on May 20, 2026 at 7:51 pm

    If you do it cleverly, it can be very fast. Let the database do the work.

    SELECT * FROM USERS WHERE Name IN ( <generated list of your 500 user name candidates>)
    

    The returned list will be the ones of the 500 which already exist in the database. Such as call will be fast, at most a few seconds on a slow database.

    Cheers,
    Daniel

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

Sidebar

Related Questions

Lets say I have a list of 1,000,000 users where their unique identifier is
Lets say I have around 1,000,000 users. I want to find out what position
Lets say I have a 10,000 digit number in my database... This would be
So lets say I have an array containing a hash like this: [{head=> {title=>$20,000
So lets say I have 10,000 points in A and 10,000 points in B
Lets say we have an average of one page fault every 20,000,000 instructions, a
Lets say i have 70,000 cycles per second, and i want to get cycles
So, lets say I have 100,000 float arrays with 100 elements each. I need
lets say; I have a $friends array with 2,000 different friendID numbers + I
i would like to insert records in set of batches. For example, lets say

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.