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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:45:25+00:00 2026-06-18T07:45:25+00:00

I recently began exploring indexing in sqlite. I’m able to successfully create an index

  • 0

I recently began exploring indexing in sqlite. I’m able to successfully create an index with my desired columns.

After doing this I took a look at the database to see that the index was created successfully only to find that sqlite had already auto created indexes for each of my tables:
“sqlite_autoindex_tablename_1”

These auto generated indices used two columns of each table, the two columns that make up my composite primary key. Is this just a normal thing for sqlite to do when using composite primary keys?

Since I’ll be doing most of my queries based on these two columns, does it make sense to manually create indices, which are the exact same thing?

New to indices so really appreciate any support/feedback/tips, etc — thank you!

  • 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-18T07:45:26+00:00Added an answer on June 18, 2026 at 7:45 am

    SQLite requires an index to enforce the PRIMARY KEY constraint — without an index, enforcing the constraint would slow dramatically as the table grows in size. Constraints and indexes are not identical, but I don’t know of any relational database that does not automatically create an index to enforce primary keys. So yes, this is normal behavior for any relational database.

    If the purpose of creating an index is to optimize searches where you have an indexable search term that involves the first column in the index then there’s no reason to create an additional index on the column(s) — SQLite will use the automatically created one.

    If your searches will involve the second column in the index without including an indexable term for the first column you will need to create your index. Neither SQLite (nor any other relational database I know of) can use composite indexes to optimize filtering when the head columns of the index are not specified in the search.

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

Sidebar

Related Questions

Recently our WPF/Entity Framework 4.0 application has become unstable after we began using backgroundworkers
So, recently, after accruing quite a few js and css files, I began thinking
I recently began doing facebook application development. But it seems that the information out
I recently began exploring Scapy. A wonderful tool indeed! I have a problem... When
I've recently started to use SQLite and began to integrate it into a C#
I recently began teaching myself (terrible) SQLite. One thing that struck me as annoying
I've only recently began using the debugger extensively, so I'm not sure if this
I recently began working on a large ASP.NET WebForms project. The project was using
I recently began working on a large project that contains a huge number of
I recently began to read some F# related literature, speaking of Real World Functional

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.