ankane/dexter

syntax error at or near "ANALYZE" at character 23

darthf1 opened this issue · 1 comments

Hi! I'm trying to use Dexter. I got Dexter to run and it started to analyze the log. It found new fingerprints, but I didn't see any index generation. This could of course be a good thing, but when I ran it again with --log-level debug2 I saw some strange things.

Below it says Could not run explain.

Query 02cf8b8c58bb4d28b0b2f4eab14ec3942e9ac6c1ee
Total time: 0.0 min, avg time: 106 ms, calls: 1
Could not run explain

ANALYZE "public"."mytable"

If I check the postgresql log file, I noticed the following lines:

STATEMENT: EXPLAIN ...
ERROR:  syntax error at or near "ANALYZE" at character 23
STATEMENT:  EXPLAIN (FORMAT JSON) ANALYZE "public"."mytable"
ERROR:  syntax error at or near "ANALYZE" at character 23
STATEMENT: EXPLAIN ...

I don't know if the line corresponding with the ERROR should be above or below the STATEMENT, but I got this error multiple times for different queries.

I'm using PostgreSQL 11.7. I built Dexter on alpine-linux from master.

Hey @darthf1, thanks for reporting! Those errors aren't anything to worry about. Dexter tries to explain every statement, but some like ANALYZE statements can't be explained, so it skips them.