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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:20:44+00:00 2026-06-02T13:20:44+00:00

I run a recipe website that uses PostgreSQL 9.1 as a backend. When a

  • 0

I run a recipe website that uses PostgreSQL 9.1 as a backend. When a user searches for recipes, I build a query on the fly depending on what the user wants to find. For example, if the user wants to find all recipes that have a cook time under 30 minutes, I would generate the query:

SELECT * From Recipes WHERE CookTime < 30;

I now have the need to “hide” certain recipes, meaning they will never show up in any search, ever. The only way to get to them would be knowing the URL directly. To do this, I’ve added a new column to the Recipes table:

ALTER TABLE Recipes ADD COLUMN Hidden boolean not null default false;
CREATE INDEX IDX_Recipes_Hidden ON Recipes(Hidden);

My idea is to just hard code the phrase “NOT HIDDEN” into every WHERE clause. For example, the query above would now be:

select * from recipes where not Hidden and CookTime < 30;

My Question:

According to the query analyzer, this will now generate a bitmap to combine the two indexes. Keep in mind 99% of the recipes will not be hidden. I want to know if this technique is the best, and fastest way to exclude certain recipes from all queries. I know the absolute fastest way would be to create a separate table for hidden recipes, however this would be a massive amount of re-factoring so I’d like to avoid this.

  • 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-02T13:20:46+00:00Added an answer on June 2, 2026 at 1:20 pm

    Do you have any performance issues? If there are no issues with your solution it makes no sense to waste more time on something that needs no change.

    A bitmap index is fine for something where you have not many different values. So in your case where you only have true and false it is fine.

    You could just build something like a materialized view but this seems to be to much work and it would be probably easier for you to just create a second table, but if you do not have any issues don’t change anything.

    MVs in postgres: http://tech.jonathangardner.net/wiki/PostgreSQL/Materialized_Views

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

Sidebar

Related Questions

I run a query against a MySQL database to get total number of visits
I run a lost and found pet website and am having trouble listing lost
I run across this often enough that I figure there has to be a
I want to build and run my project in Netbeans. I generated a simple
I am working on a cookbook website using django and have run into a
We are working on chef recipe that builds PHP from source. However, every time
First off, can (and is it good practice) chef run a recipe at a
i have set up buildout project (django to be specific) that has to run
With chef, is it possible to add something to a recipe that is installing
I'm trying to get a recipe working that I found online for doing expectation

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.