Let\'s say I have a database table that I want to filter based on a boolean attribute (for example, \"flagged\" attribute). Is it better to just add a \"flagged\" attribute
It depends. I myself prefer adding a new table when the value is not really related to the table/relation.
A good example of this is when you have table representing orders and you want to keep track of which ones has been printed. I would add new table called printed_orders with a foreign key to the order.
create table printed_orders (
order_id int primary key references order(order_id)
);
If its been printed or not is not really part of the order but part of the system/business rules.