LunaSea an hour ago

I would disagree on the fact that a table without a primary key is a critical problem.

There are multiple reasons for tables not having primary keys. Log tables are one example.

Excessive sequential scans is also not a problem for small tables.

  • davidw 16 minutes ago

    This looks like it's targeted at finding some obvious things, and if you know your table doesn't need a primary key, you could always exclude it from the report.

sumibi 43 minutes ago

This is inspired by the first responder kit from Brent Ozar for SQL Server, which is an amazing tool for accidental DBAs that do not know where to start optimizing.

I'm looking forward to trying out this on my postgres databases.

netcraft 3 hours ago

Very nice!

Did you consider making this a view instead? Just curious if there is a reason why you couldn't.

  • singron 2 hours ago

    I'm not the author, but I think you could by using UNION ALL instead of temp tables. You could also make a view that just calls this function. I'm not sure why it would matter though.