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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:21:26+00:00 2026-05-25T21:21:26+00:00

Here is my table: CREATE TABLE `letters` ( `a` bigint(20) unsigned NOT NULL, `b`

  • 0

Here is my table:

CREATE TABLE `letters` (
  `a` bigint(20) unsigned NOT NULL,
  `b` bigint(20) unsigned NOT NULL,
  `c` bigint(20) unsigned NOT NULL,
  `d` bigint(20) unsigned NOT NULL,
  `e` bigint(20) unsigned NOT NULL,
  PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8$$
  • The table will have about 1+ billion rows.
  • Each column can be queried; each column can be referenced. e.g.:
    • SELECT [any column] FROM letters WHERE [any / any other column] IN ([subquery or list]);

My question: what indices should I add to speed up any query in the format above? (Also, if possible, please try to describe ‘why’ it/they should be added so that I can learn from your answer).

Thanks!

— Extra info: inserts will happen on a fairly regular basis (a few/handful every second) but select queries will happen more frequently.

  • 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-25T21:21:27+00:00Added an answer on May 25, 2026 at 9:21 pm

    Since any column can appear in the WHERE clause, you’ve to add an index for each of the column, except for the field a since is already the PRIMARY KEY and as such is already indexed.

    UPDATE: as for the subsequent discussion, Poodlehat pointed out that the column e has a low index selectivity, i.e. “The ratio of the number of distinct values in the indexed column / columns to the number of records in the table”. For this reason, it’s not clear whether adding an index on column e will help or slow down queries. So Lucas will try experimentally and hopefully share the results to us.

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

Sidebar

Related Questions

Here's my table: CREATE TABLE `alums_alumphoto` ( `id` int(11) NOT NULL auto_increment, `alum_id` int(11)
Here is a table i have CREATE TABLE `CUSTOMERSTATUSTYPES` ( `CustomerStatusId` int(1) unsigned NOT
Here's the scenario: I have 2 tables: CREATE TABLE dbo.API_User ( id int NOT
Here's my table: dbo.Posts PostId (IDENTITY, PK) Subject UniqueUri (NVARCHAR(350), NOT NULL) When i
CREATE TABLE #Report( Cell int, CellValue double) Error here DECLARE @Report TABLE ( Cell
Here is an example of what I've got going on: CREATE TABLE Parent (id
I'm trying the following: CREATE TABLE Table1 ( RecordNo autonumber, --error here! PersonId varchar(50),
I have two tables: entitytype and project . Here are the create table statements:
First.. here are the two tables I've created (sans irrelevant columns).. CREATE TABLE users_history1
How can I create a table with autoincrement in access. Here is what I

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.