How Isok Works
Prev |  | Next

## How Isok Works

Isok is a PostgreSQL extension for monitoring anything that can be reported with an SQL query. Unlike simply running a query, which reports the existence of questionable data patterns, Isok produces reports alerting you of changes to questionable data patterns, so that only new problems need be reviewed.

In this way, Isok makes practical the monitoring and management of unusual, but sometimes allowed, data patterns. It has record-keeping and scheduling features to assist with the management of problem resolution over time.

To use Isok you write SQL queries that produce reports alerting you of questionable data patterns. Then, on a row by row basis, you can defer, possibly forever, the appearance of individual alerts on future reports.

Isok is useful to periodically probe for unusual but allowed activity, such as the addition of a new country code. Or the purchase of more than 1,000 shoes by one person. Approved excessive shoe purchases can be individually flagged so they do not appear in future reports. To avoid being overwhelmed by numerous legitimate alerts and to allow time to resolve issues, specific rows in the reports can be deferred so they do not reappear before a designated date.

Unlike triggers and constraints, Isok does nothing until executed.[4] This is done by SELECTing FROM a function, which runs some or all of the saved queries to check the state of the database and report the results. Report content is archived and can be queried.

A reported issue, a row returned by a saved query, is classified as either an error or a warning. Errors are always reported when Isok is run. After execution, the warnings reported by the user-supplied queries may be manually sorted by the Isok user into one of the following categories: unclassified (the default), labeled “resolved”, or deferred until a later date. When Isok is run, unclassified warnings are reported, “resolved” warnings are not reported, and deferred warnings are not reported until the current date reaches the deferral date.

PostgreSQL supports a high degree of introspection. Isok can therefore monitor PostgreSQL itself, both the database engine's operational metrics and database schema design. In the former case system performance or usage might be monitored. In the latter, monitoring might look for things like violations of column naming conventions. However, while there may be legitimate uses of Isok for these sorts of purposes, other tools may be a better fit.

Regardless of how Isok is used, we believe some monitoring or some error checking is better than no monitoring and no error checking. Isok makes monitoring and error checking easy. If introducing triggers into your processing or running a complete performance monitoring solution is just not feasible, Isok provides a simple way to move the ball at least a little bit closer to the goal.

[4] There is an appendix on automating Isok execution.

Prev |  | Next
Why Use Isok? | Home | A Start-To-Finish Set of Examples

Page generated: 2025-12-15T15:11:24-06:00.