Search code examples
sqlpostgresqlanomaly-detection

Is there a way to look at the back-end processing of PostgreSQL?


I am new to StackOverflow so please do correct me if I need to provide any more information.

I am trying to integrate an anomaly detection into the PostgreSQL database system by plugging into its backend.

I would like to know if there is any place where I can find extensive back-end coding or integration examples. I am looking at papers regarding this topic and, so far, I have found a few which talk about the methods that the queries are classified and used for anomaly detection.

If you do know about any websites which might help me, please do provide links to the sites.

Thanks!!


Solution

  • Look for "hooks" in the PostgreSQL source tree. Studying the source of the auto_explain and pg_stat_statements contrib modules, which track query execution, will show you the way.

    The source is its own book: it is well-documented and interspersed with README files that explain the design.