Get "current" rows count from table

Viewed 32

One transaction inserts into some_table. Large data inserted so it running few minutes.

While insertion happens, if do from another transaction:

SELECT COUNT(*) FROM some_table;

it shows row count before insertion started, right?

Question: Is there any way, to check current row count in table? so it would count, what rows already inserted by first transaction too, for this moment. Is this even possible ?

1 Answers

I don't think so. A transaction isn't saved to the database until commit and a transaction isn't view-able by any other session.

Of course I could be wrong but I can't think of a way of doing that.

Related