Subject Re: Performance - Querying newly inserted records for processing - which better?
Author Eugenio Reis
> Which is faster to query for newly inserted records for some task
processing?
>
> METHOD 1 - Use a composite key with a field denoting 'N' for newly
inserted rows, 'P' for processed rows. Once processed, update this
indexed field from 'N' to 'P'.
> METHOD 2 - Use another table to keep the IDs of newly inserted rows

I would stick to method 2. A btree index based on a field of just two
different values (the lowest cardinality) would be the worst case
scenario for such kind of index. You may also consider the possibility
of inserting a timestamp rather than just a N/P flag. This would give
you more flexibility.