Posts

aaa

Oracle AI Database 26ai(23.26.4):SELECT FOR UPDATE with Row Limit

  Oracle AI Database 26ai Release 23.26.4 introduces support for combining Top-N queries using the FETCH FIRST clause with FOR UPDATE [SKIP LOCKED]. This enhancement allows applications to retrieve and lock a limited number of rows using the FETCH FIRST clause, simplifying the implementation of batch-processing operations that require controlled row-level locking. Testing the Feature The PERSON table contains the following rows: SQL > select * from person; ID FNAME LNAME SAL ---------- ---------- --------------- ---------- 1 Vahid Yousefzadeh 4 2 Nader DastNeshan 5 3 Kourosh Barmak 6 The FETCH FIRST clause works correctly when used without FOR UPDATE SKIP LOCKED : SQL > select * from person order by 1 FETCH FIRST 1 ROWS ONLY ; ID FNAME LNAME SAL ---------- ---------- --------------- ---------- 1 Vahid ...

PostgreSQL 19 — Monitoring Lock Contention and Fast-Path Overflow with pg_stat_lock

  PostgreSQL 19 introduces the pg_stat_lock view, which provides cumulative statistics about lock activity across the database cluster. It helps database administrators investigate lock contention, measure time spent waiting for locks, and identify situations where relation locks exceed the available fast-path slots. In this article, I will demonstrate these capabilities through two practical scenarios. postgres = # \d pg_stat_lock View "pg_catalog.pg_stat_lock" Column | Type | Collation | Nullable | Default -------------------+--------------------------+-----------+----------+--------- locktype | text | | | waits | bigint | | | wait_time | double precision | | | fastpath_exceeded | bigint | | | stats_reset | timestamp...