CREATE TABLE sales ( id BIGINT PRIMARY KEY, salesclerk INTEGER NOT NULL, sales_date TIMESTAMP NOT NULL );
DETAIL: CPU 0.00s/0.00u sec elapsed 0.00 sec. INFO: "tbl": found 4 removable, 1 nonremovable row versions in 1 pages DETAIL: 0 dead row versions cannot be removed yet. There were 0 unused item pointers. 0 pages are entirely empty. CPU 0.00s/0.00u sec elapsed 0.00 sec. INFO: "toast_item": truncated 1 to 0 pages
=# SELECT * FROM pg_locks ; relation | database | transaction | pid | mode | granted ----------+----------+-------------+------+-----------------+--------- 177381 | 177205 | | 3738 | AccessShareLock | t 177381 | 177205 | | 3738 | RowShareLock | t | | 1226 | 3738 | ExclusiveLock | t 16759 | 177205 | | 3736 | AccessShareLock | t | | 1228 | 3736 | ExclusiveLock | t (5 rows)
=> EXPLAIN SELECT i.name FROM sales s -> JOIN item i ON i.id = s.item_id WHERE s.number > 10; QUERY PLAN ------------------------------------------------------------------- Hash Join (cost=2.27..3.74 rows=6 width=31) Hash Cond: ("outer".id = "inner".item_id) -> Seq Scan on item i (cost=0.00..1.15 rows=15 width=35) -> Hash (cost=2.25..2.25 rows=6 width=4) -> Seq Scan on sales s (cost=0.00..2.25 rows=6 width=4) Filter: (number > 10) (6 rows)