> > This seems to be such a commonly needed task. Shouldn't this be
> > incorporated into psql?
>
> I still like my patch: it performs a little differently from the
> EXPLAIN ANALYZE function. You turn it on and off with the
> a "\m", and it records the time it takes everything to run,
> even things like index creation, which EXPLAIN ANALYZE does not
> handle. Plus, you don't have to go back and re-run the query
> if you want to time it: it simply presents the timing information
> after every query, until you turn the option off:
>
> template1=# SELECT count(*) FROM baz;
>
> count
> -------
> 15212
>
> TOTAL TIME: 0.004665
>
> template1=# CREATE INDEX foobar ON baz(waldo);
>
> CREATE
>
> TOTAL TIME: 0.011012
Yes, this does seem nice.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026