Introducing Dexter, the Automatic Indexer for Postgres
Andrew Kane
2524

Nice work — I hope it works for GIST indexes: they’re the ones I usually forget to add (if you forget to index the geometry column for a decent-sized PostGIS table, spatial queries are slow as a wet week).

That said, my “live-template” for table creation now triggers

CREATE INDEX [table]_g1_idx ON [schema].[table] USING GIST(g1);

for any table with a column called ‘g1' (the default for a geometry column in our PostGIS data model). Even though spatial indexes add to disk use (bigly), they’re unavoidable.

We do the same to ensure that PK and FK constraints exist on canonically-PK/FK columns.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.