I have written a daemon processor which will fetch rows from one database and insert them into another for synchronizing. It will fetch rows based on a boolean
boolean
A table with records and a boolean field should be the way to do it.
Here is something which I believe might help you...
Bitmap Index
Alternative of Bitmap Index in PostgreSQL