<<Could you use CLUSTER on the table after it had been closed off?  If
appropriate, that should make the queries run much faster, as elated entries
will be in the same or nearby blocks on disk.

>> 

 

Technically, yes. That would really help, but the issue is scheduling.
Although the logs are closed off for writes, they aren't closed off for
reads, ref PG documentation: "When a table is being clustered, an ACCESS
EXCLUSIVE lock is acquired on it. This prevents any other database
operations (both reads and writes) from operating on the table until the
CLUSTER is finished."

 

Not ideal, but a lot better than doing nothing at all!

Reply via email to