Neki, sharded Postgres, is now available. Learn more
Navigation

Choose the query planner for Neki

Neki now has two query planners you can pick between. fast remains the default. It builds the join order one table at a time, taking the join that looks cheapest at each step. The new deep planner compares complete join orders by cost before choosing. This allows it to find a better plan for queries that join multiple tables.

If deep can't plan a query correctly, Neki falls back to the default fast planner.

To use deep, add it to your connection string:

?options=-c%20__neki.planner%3Ddeep

Or make it the default for a database or a role:

ALTER DATABASE postgres SET "__neki.planner" = 'deep';

You can also switch inside a session with SET __neki.planner = 'deep'; and compare the two plans with EXPLAIN.

Read more