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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:44:12+00:00 2026-06-11T09:44:12+00:00

I have a table with about 30 columns, column a integer not null ,

  • 0

I have a table with about 30 columns, column a integer not null, b boolean not null and c integer not null among them. And there is a query that is often run with a = 2 and b is true and c = <something>, i.e.

select * from my_table where a = 2 and b is true and c = 3215

The question is: should I include a and b columns in partial index, like this:

CREATE INDEX idx_my_table_a_b_c
ON my_table 
USING btree  (a, b, c)
WHERE a = 2 AND b IS TRUE;

or should I not, like this:

CREATE INDEX idx_my_table_a_b_c
ON my_table 
USING btree  (c)
WHERE a = 2 AND b IS TRUE;

In the first case explain outputs

"Index Scan using idx_my_table_a_b_c on my_table  (cost=0.00..8.27 rows=1 width=4007)"
"  Index Cond: ((b = true) AND (a = 2))"

and in the second Index cond part is absent

"Index Scan using idx_my_table_a_b_c on my_table  (cost=0.00..8.27 rows=1 width=4007)"

And by the way what does Index cond mean?

  • 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-11T09:44:13+00:00Added an answer on June 11, 2026 at 9:44 am

    If your index predicate is strict equality then there is no point in including the predicate columns in the index. Every index entry will have the same values for the columns and so won’t contribute to index lookup, they will only slow down inserts and lookups and bloat the index.

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

Sidebar

Related Questions

When I have the following table: CREATE TABLE test ( id integer NOT NULL,
Okay, here's the situation: We have a table of about 50 columns (created by
I have a Fusion Table of about 1000 entries, and I show them on
I have a table containing data about some users. Many of them use our
I have a MySQL table with about 5,000,000 rows that are being constantly updated
I have a java web application that selects one column from table (with 6
I have the following table: CREATE TABLE `events` ( `evt_id` int(11) NOT NULL AUTO_INCREMENT,
I have a user table that has many columns, it looks roughly like this:
When using integer columns is it better to have 0 or NULL to indicate
I have a table with about 5,000 rows which I build dynamically with jQyuery.

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.