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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:18:19+00:00 2026-05-15T00:18:19+00:00

I am sorry if this is a dumb question (cause it sounds unlikely). I

  • 0

I am sorry if this is a dumb question (cause it sounds unlikely).

I have a table that is 20 Million rows. However, only about 300K of these rows get accessed regularly, and they can be identified in a column condition called “app_user=1”

Is there anyway i can just index those rows, and when I call a select, i will be sure to pass in the condition as well?

  • 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-15T00:18:20+00:00Added an answer on May 15, 2026 at 12:18 am

    I would recommend splitting the table into two separate tables. But in case you don’t want to do that, the highest performance way to do this if you’re always going to include “where app_user=1” in your queries is to create a primary key on the table that includes the app_user column as the first part of the key. InnoDB will use this as a clustered index which saves you a few extra disk accesses. You can create the table like this:

    create table testTable (
    app_user tinyint UNSIGNED default 0,
    id int UNSIGNED NOT NULL,
    name varchar(255) default ”,
    PRIMARY KEY k1(app_user, id)
    ) ENGINE=InnoDB;

    A friend wrote this article on clustered indexes in InnoDB a while back:
    http://www.joehruska.com/?p=6

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

Sidebar

Related Questions

Sorry if this is a dumb question but im creating a filter class that
am sorry for this dumb beginner question, but i have a real problem understanding
Sorry this is probably a dumb question but I have been struggling with this
I am sorry if this question sounds dumb. Why does inverse document frequency use
Sorry if this is a dumb question. I don't ever have to write anything
Sorry if this is a dumb question, but I have absolutely no idea how
sorry for asking this dumb question i will try to explain as good as
Sorry if this is a dumb question. I'm using .each to loop through a
Sorry if this is a dumb question, but it is possible to store, and
I am just starting out C++, so sorry if this is a dumb question.

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.