All Questions

Filter by
Sorted by
Tagged with
1
vote
1answer
38 views

PostgreSQL Index Only Scan can NOT return ctid

I have this table in PostgreSQL 11: CREATE TABLE A (id bigint PRIMARY KEY, text text) Now I want to fetch the ctid of rows meeting some condition like id = 123. However, even using pg_hint_plan to ...
3
votes
1answer
463 views

One big table vs few smaller

Please take note that the example below is just an example, my scenario is way more complex and the way i'm trying to model it really makes sense Let's say i'm creating a table for audit events in ...
9
votes
2answers
17k views

What is the fastest way to fetch the last row from a table?

I have a PostgreSQL table, Prices, with the columns: price (Decimal) product_id (Int) There are also created_at and updated_at columns. Prices get updated regularly and I keep old prices in the ...
9
votes
1answer
2k views

How does PostgreSQL physically order new records on disk (after a cluster on primary key)?

Need to know how PostgreSQL orders records on disk. In this case, I would like to take advantage of index combination as stated in the docs, which as I understand uses bitmaps to get matching rows ...