안녕하세요 현재 postgresql dbms 사용하고있으며
환경은 OLTP 환경입니다.
트랜잭션이 완료되면 commit을 찍는데 select에는 commit명령이 따로 발생하지 않는건지
궁금해 문의드립니다!!
PostgreSQL 문서에는 SELECT를 포함한 모든 SQL이 트랜잭션 (BEGIN ~ COMMIT) 내에서 실행된다고 하네요
PostgreSQL actually treats every SQL statement as being executed within a transaction. If you do not issue a BEGIN command, then each individual statement has an implicit BEGIN and (if successful) COMMIT wrapped around it. A group of statements surrounded by BEGIN and COMMIT is sometimes called a transaction block.
https://www.postgresql.org/docs/13/tutorial-transactions.html
pg_stat_database에서 xact_commit 값을 참고하시면 좋을 듯 합니다.
postgres=# select xact_commit from pg_stat_database where datname='postgres'
postgres-# ;
xact_commit
-------------
850753
(1 row)
postgres=# select xact_commit from pg_stat_database where datname='postgres'
;
xact_commit
-------------
850754
(1 row)