Re: Analyzing last run query in psql
| От | Luca Ferrari |
|---|---|
| Тема | Re: Analyzing last run query in psql |
| Дата | |
| Msg-id | CAKoxK+65Cxdy56tUg8c_+8hJgqmry0ub5HpBVpPtBMvL65eiJw@mail.gmail.com обсуждение исходный текст |
| Ответ на | Analyzing last run query in psql (Joe Van Dyk <joe@tanga.com>) |
| Список | pgsql-general |
On Wed, Jul 3, 2013 at 7:05 AM, Joe Van Dyk <joe@tanga.com> wrote: > I frequently need to analyze the last query in psql: > select * from table where id = 1; > explain analyze select * from table where id = 1; > > It would be nice to be able to do this: > explain analyze $LAST > > (or can I do something like that already?) > > I'm not using psql interactively, I pipe files into psql (if it matters). I don't know of any feature like that, but maybe you can do the following in your script/files: \set lastquery 'your-query-here' so that you can do something like explain :lastquery; But if you are able to manipulate your scripts you can just insert the explain by hand on queries you are interested in, or use autoexplain for all the queries. Luca
В списке pgsql-general по дате отправления: