Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value

Поиск
Список
Период
Сортировка
Искать
От
Yugo NAGATA
Тема
Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value
Дата
Msg-id
20240308153155.4c4b2fee3ed1431203e41016@sraoss.co.jp
Ответ на
Список
Дерево обсуждения
pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value Yugo NAGATA <nagata@sraoss.co.jp>
Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value Nikita Malakhov <hukutoc@gmail.com>
Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value Yugo NAGATA <nagata@sraoss.co.jp>
Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value Yugo NAGATA <nagata@sraoss.co.jp>
Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value Sergei Kornilov <sk@zsrv.org>
Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value jian he <jian.universality@gmail.com>
Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value jian he <jian.universality@gmail.com>
Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value Yugo NAGATA <nagata@sraoss.co.jp>
Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value jian he <jian.universality@gmail.com>
Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value Yugo NAGATA <nagata@sraoss.co.jp>
Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value jian he <jian.universality@gmail.com>
Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value Yugo NAGATA <nagata@sraoss.co.jp>
Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value jian he <jian.universality@gmail.com>
Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value Yugo NAGATA <nagata@sraoss.co.jp>
Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value jian he <jian.universality@gmail.com>
Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value Yugo NAGATA <nagata@sraoss.co.jp>
Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value Nathan Bossart <nathandbossart@gmail.com>
Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value Yugo NAGATA <nagata@sraoss.co.jp>
Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value Nathan Bossart <nathandbossart@gmail.com>
Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value Yugo NAGATA <nagata@sraoss.co.jp>
Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value Nathan Bossart <nathandbossart@gmail.com>
Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value Yugo NAGATA <nagata@sraoss.co.jp>
Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value Nathan Bossart <nathandbossart@gmail.com>
Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value Yugo NAGATA <nagata@sraoss.co.jp>
Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value Nathan Bossart <nathandbossart@gmail.com>
Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value Yugo NAGATA <nagata@sraoss.co.jp>
On Thu, 7 Mar 2024 16:56:17 -0600
Nathan Bossart  wrote:

> On Mon, Feb 05, 2024 at 04:28:23PM +0900, Yugo NAGATA wrote:
> > On Thu, 1 Feb 2024 17:59:56 +0800
> > jian he  wrote:
> >> v6 patch looks good.
> > 
> > Thank you for your review and updating the status to RwC!
> 
> I think this one needs a (pretty trivial) rebase.  I spent a few minutes
> testing it out and looking at the code, and it seems generally reasonable

Thank you for your review.
I've attached a rebased patch.

> to me.  Do you think it's worth adding something like a
> pg_column_toast_num_chunks() function that returns the number of chunks for
> the TOASTed value, too?

If we want to know the number of chunks of a specified chunk_id,
we can get this by the following query.

postgres=# SELECT id, (SELECT count(*) FROM pg_toast.pg_toast_16384 WHERE chunk_id = id) 
  FROM (SELECT pg_column_toast_chunk_id(v) AS id FROM t);

  id   | count 
-------+-------
 16389 |     3
 16390 |   287
(2 rows)


However, if there are needs for getting such information in a
simpler way, it might be worth making a new function.

Regards,
Yugo Nagata

> -- 
> Nathan Bossart
> Amazon Web Services: https://aws.amazon.com


-- 
Yugo NAGATA 
В списке pgsql-hackers по дате отправления
От: Bharath Rupireddy
Дата:
От: Michael Paquier
Дата:
FAQ