pg_shard icon indicating copy to clipboard operation
pg_shard copied to clipboard

Support EXPLAIN command

Open bonesmoses opened this issue 9 years ago • 1 comments

Currently when an EXPLAIN is applied to a query, the following output is produced:

ERROR:  EXPLAIN statements on distributed tables are unsupported

This makes it effectively impossible to troubleshoot queries on tables using pg_shard. Even something as simple as executing the EXPLAIN on candidate worker nodes and combining the results would be sufficient as a replacement for this error.

bonesmoses avatar Mar 12 '15 18:03 bonesmoses

As you've already discovered, enabling auto_explain on worker nodes is one workaround, but that's not very proactive.

Which shards would the query run on? How much data came from each candidate shard?

I agree that a "just ask a shard" approach is a nice first pass, but as you've noted, more advanced capabilities are possible if we keep statistics about the shards. CitusDB does this to help plan distributed joins (especially important is just the shard size), and I think pg_shard could benefit from a bit of that as well.

jasonmp85 avatar Mar 13 '15 22:03 jasonmp85