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 7038015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:37:06+00:00 2026-05-28T01:37:06+00:00

I have a class called Stream that has many records in the database, and

  • 0

I have a class called Stream that has many records in the database, and many more are constantly being added to it. A field in the streams table called rating can be -1, 0, 1, or be null. I will say “rated” as having rating -1, 0, or 1, and “unrated” as having a null rating. As of right now, there are 24M records in the streams table. 20M are rated, 4M are unrated. The streams table needs to be queried often for the unrated records. The problem is, it takes time to query such a large table.

I thought of breaking up the streams table into 3 separate tables. There could be a rated streams table, an unrated streams table, and an old unrated streams table. The way it would work would be, a new stream is created. New records are unrated, so it would be placed in the unrated streams table. If it is rated, it would be moved to the rated streams table. If it is unrated for more than a week, it would be moved to the old unrated streams table. I would still need to be able to use methods and associations from the Stream class seamlessly, like:

buzz.rated_streams.first
interest.unrated_streams.first
user.old_streams.first
RatedStream.find(1).buzz
UnratedStream.find(2).interest
OldStream.find(3).user

The unrated streams table could be queried much faster. The rated streams table would be useful for analysis. The old unrated streams table would be a dump for old data.

I have some questions. Would breaking up the table be a good idea? If so, how would I do it to keep everything from breaking, and use the same methods and associations from the Stream class? If breaking up the table is a bad idea, what should I do instead?

  • 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-28T01:37:07+00:00Added an answer on May 28, 2026 at 1:37 am

    I think this is a baaaaad idea. A lot of custom code (which is not guaranteed to work).

    You should create an index on rating instead. This will likely solve all your problems with queries (you might want to make it covered also).

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

Sidebar

Related Questions

I have a class called Question that has a property called Type. Based on
I have a class called DatabaseHelper that wraps a DbConnection. What's the proper way
I have a class called UserInfo that contains details about a given user. There
I have a class that represents a data stream, it basically reads or writes
I have a class called Sound.java that consists of 3 functions (initSound, addSound, and
I have a class called XorIsoStoreFileStream inheriting from IsolatedStorageFileStream, and the point is that
I have a class that handles serialization in C#, called Serializer. It's implementation is
I have a class called EventConsumer which defines an event EventConsumed and a method
I have a class called Ship and a class called Lifeboat Lifeboat inherits from
I have this class called Table: class Table { public string Name { get

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.