Re: [GENERAL] Determine size of table before it's committed?

Поиск
Список
Период
Сортировка
От Justin Pryzby
Тема Re: [GENERAL] Determine size of table before it's committed?
Дата
Msg-id 20171011135310.GE32739@telsasoft.com
обсуждение исходный текст
Ответ на [GENERAL] Determine size of table before it's committed?  (Seamus Abshere <seamus@abshere.net>)
Список pgsql-general
On Wed, Oct 11, 2017 at 10:43:26AM -0300, Seamus Abshere wrote:
> I've had an `INSERT INTO x SELECT FROM [...]` query running for more
> then 2 days.
> 
> Is there a way to see how big x has gotten? Even a very rough estimate
> (off by a gigabyte) would be fine.

On linux:

Run ps -fu postgres (or SELECT pid, query FROM pg_stat_activity) and
look at: ls -l /proc/PID/fd

writing to XXXXXX.22 means it's written ~22GB.

You can also SELECT relfilenode FROM pg_class WHERE oid='x'::regclass (or
relname='x').

Or try using strace (but beware I've seen its interruption to syscalls change
the behavior of the program being straced).

Justin


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

В списке pgsql-general по дате отправления:

Предыдущее
От: Seamus Abshere
Дата:
Сообщение: [GENERAL] Determine size of table before it's committed?
Следующее
От: Melvin Davidson
Дата:
Сообщение: Re: [GENERAL] Determine size of table before it's committed?