Sequences vs statistics - Mailing list pgsql-admin

From Herbey Eric Zepeda
Subject Sequences vs statistics
Date
Msg-id CAE7DxbZ4oXo7S4g_QpYNX3U1WhD2hQBXVqa6HZPa6oud8OvwFw@mail.gmail.com
Whole thread Raw
Responses Re: Sequences vs statistics
List pgsql-admin
Hi, I'm in the process of deciding whether to use.

-1 sequence per table containing the number of rows
-Using the collected statistics and functions like pg_relation_size

This is my use case:

I have several hundred tables in one database that I would like to 
constantly monitor as far as size or number of records.

When a certain threshold is met, I will not allow any further inserts
into that table.
The threshold-met-event can be approximate.

How will I affect the performance of the server if I chose to query 
for the system statistics data say, every 5 seconds as opposed to
just reading the latest_value of a sequence that gets updated every time
a row is added to its corresponding table?

Thank you



pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: displaying UTC time in local time
Next
From: David Johnston
Date:
Subject: Re: Sequences vs statistics