|
27 | 27 | #include "optimizer/planmain.h"
|
28 | 28 | #include "parser/parsetree.h"
|
29 | 29 | #include "rewrite/rewriteHandler.h"
|
| 30 | +#include "storage/bufmgr.h" |
30 | 31 | #include "tcop/tcopprot.h"
|
31 | 32 | #include "utils/builtins.h"
|
32 | 33 | #include "utils/json.h"
|
@@ -698,16 +699,20 @@ report_triggers(ResultRelInfo *rInfo, bool show_relname, ExplainState *es)
|
698 | 699 | appendStringInfo(es->str, " for constraint %s", conname);
|
699 | 700 | if (show_relname)
|
700 | 701 | appendStringInfo(es->str, " on %s", relname);
|
701 |
| - appendStringInfo(es->str, ": time=%.3f calls=%.0f\n", |
702 |
| - 1000.0 * instr->total, instr->ntuples); |
| 702 | + if (es->timing) |
| 703 | + appendStringInfo(es->str, ": time=%.3f calls=%.0f\n", |
| 704 | + 1000.0 * instr->total, instr->ntuples); |
| 705 | + else |
| 706 | + appendStringInfo(es->str, ": calls=%.0f\n", instr->ntuples); |
703 | 707 | }
|
704 | 708 | else
|
705 | 709 | {
|
706 | 710 | ExplainPropertyText("Trigger Name", trig->tgname, es);
|
707 | 711 | if (conname)
|
708 | 712 | ExplainPropertyText("Constraint Name", conname, es);
|
709 | 713 | ExplainPropertyText("Relation", relname, es);
|
710 |
| - ExplainPropertyFloat("Time", 1000.0 * instr->total, 3, es); |
| 714 | + if (es->timing) |
| 715 | + ExplainPropertyFloat("Time", 1000.0 * instr->total, 3, es); |
711 | 716 | ExplainPropertyFloat("Calls", instr->ntuples, 0, es);
|
712 | 717 | }
|
713 | 718 |
|
@@ -2429,8 +2434,11 @@ show_buffer_usage(ExplainState *es, const BufferUsage *usage)
|
2429 | 2434 | ExplainPropertyLong("Local Written Blocks", usage->local_blks_written, es);
|
2430 | 2435 | ExplainPropertyLong("Temp Read Blocks", usage->temp_blks_read, es);
|
2431 | 2436 | ExplainPropertyLong("Temp Written Blocks", usage->temp_blks_written, es);
|
2432 |
| - ExplainPropertyFloat("I/O Read Time", INSTR_TIME_GET_MILLISEC(usage->blk_read_time), 3, es); |
2433 |
| - ExplainPropertyFloat("I/O Write Time", INSTR_TIME_GET_MILLISEC(usage->blk_write_time), 3, es); |
| 2437 | + if (track_io_timing) |
| 2438 | + { |
| 2439 | + ExplainPropertyFloat("I/O Read Time", INSTR_TIME_GET_MILLISEC(usage->blk_read_time), 3, es); |
| 2440 | + ExplainPropertyFloat("I/O Write Time", INSTR_TIME_GET_MILLISEC(usage->blk_write_time), 3, es); |
| 2441 | + } |
2434 | 2442 | }
|
2435 | 2443 | }
|
2436 | 2444 |
|
|
0 commit comments