I am running a recipe website that uses PostgreSQL 9.1 as a backend. When a user searches for recipes, I create a query "on the fly" depending on what the user wants to find. For example, if a user wants to find all recipes that have a cooking time of less than 30 minutes, I would generate a query:
SELECT * From Recipes WHERE CookTime < 30;
Now I need to “hide” certain recipes, which means that they will never appear in any search. The only way to reach them is by knowing the URL directly. To do this, I added a new column to the recipe table:
ALTER TABLE Recipes ADD COLUMN Hidden boolean not null default false;
CREATE INDEX IDX_Recipes_Hidden ON Recipes(Hidden);
My idea is to simply copy the phrase "NOT HIDDEN" into each WHERE clause. For example, the query above would be as follows:
select * from recipes where not Hidden and CookTime < 30;
My question is:
, . , 99% . , . , , , .