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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:59:22+00:00 2026-06-12T18:59:22+00:00

I have a join table that I want to index only for the table

  • 0

I have a join table that I want to index only for the table that is produced after the join. I have read a lot of what is out there, so I understand the index syntax CREATE INDEX my_index I cannot get my head around how you would create an index for a join table only. I just cannot figure out the syntax

Given the following tables (NOTE this is just an example):

CREATE TABLE books(
    id INT,
    title VARCHAR(50),
    author_id INT
);

CREATE TABLE authors(
    id INT,
    name VARCHAR(50)
);

How would the syntax work out to index the following query? For the purposes of this project it might not be sensible for me to keep indexs of either books or authors as both tables will be updated and inserted into frequently and I understand (correct me if wrong) that indexes slow everything down when created on frequently edited data:

 SELECT * FROM authors, books WHERE books.author_id = authors.id AND books.title LIKE '%Great%';

Thank you for your time.

  • 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-06-12T18:59:24+00:00Added an answer on June 12, 2026 at 6:59 pm

    create index on books like

        CREATE TABLE books(
    
    
    id INT,
    
    
    title VARCHAR(50),
    
        author_id INT,
    KEY idx_author_id ('author_id')
    );
    

    Check Explain Tool if you query is optimized or not

    for eg.

    EXPLAIN SELECT * FROM authors, books WHERE books.author_id = authors.id AND books.title LIKE '%Great%';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to join two tables together and have ONLY the data in Table
I have two tables that I want to join, they both have index on
I have two tables that I want to join together. Table1 Year, ID, Theme,
I have 4 different tables that I want to join. The tables are structured
I have a primary table for Articles that is linked by a join table
I have a join which deletes rows that match another table but the joining
I have an index page that I want to show all the users' profile
I have a table-valued, inline UDF. I want to filter the results of that
The Query Optimizer is estimating that the results of a join will have only
I have a many to many index table, and I want to do an

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.