add-circle-bold add-circle add-square add alarm-bell-1 alert-diamond analytics-pie-2 archive archive arrow-down-1 arrow-down-2 arrow-left-1 arrow-right-1 arrow-up-1 attachment-1 bin-paper-1 book-star button-record check-1 check-circle-1 close close-quote close cog-1 cog common-file-stack copy-paste credit-card-1 diagram-fall-down disable time-clock-midnight download-thick-bottom drawer-send envelope-letter envelope-letter expand-6 expand-6 file-code filter-1 floppy-disk flying-insect-honey folder-file-1 headphones-customer-support hierarchy-9 hyperlink-2 information-circle keyboard-arrow-down keyboard-arrow-up layout-module-1 list-bullets lock-2 lock-unlock-1 love-it messages-bubble-square move-to-top multiple-circle multiple-neutral-1 multiple-users-1 navigation-menu-horizontal navigation-menu network-browser open-quote pencil-1 pencil-write pencil-1 print-text rating-star rating-star remove-circle remove-square-1 search send-email-1 shield-warning single-neutral-actions single-neutral smiley-sad-1 smiley-unhappy smiley-indifferent smiley-smile-1_1 smiley-happy smiley-sad-1 smiley-unhappy smiley-indifferent smiley-happy smiley-thrilled social-media-twitter synchronize-arrows-1 tags-double ticket-1 ticket-1 time-clock-circle undo view-1 view-off view wench

アカウントのデータ容量の確認コマンド

以下の要領で、アカウントで使用しているデータ容量を調べられます。
(参考)https://wiki.postgresql.org/wiki/Schema_Size
 
  1. アカウントを開き、データセット一覧から、どれでもよいのでテーブルを一つ選びます。
  2. 次に、CARTOのSQLウィンドウを表示させます(1)。
  3. SQLウィンドウにいかのSQLを張り付けて(2)、実行し(3)関数を作成します。
    • CREATE OR REPLACE FUNCTION pg_schema_size(text) RETURNS BIGINT AS $$
      SELECT SUM(pg_total_relation_size(quote_ident(schemaname) || '.' || 
      quote_ident(tablename)))::BIGINT FROM pg_tables WHERE schemaname = $1
      $$ LANGUAGE SQL;
  4. その上で、以下のクエリを実行します(2、3)
    • select pg_size_pretty(pg_schema_size('アカウント名'));
  5. 例えば、以下のような値が戻ります
    • pg_size_pretty | 4782 MB


一度関数を作成すると、以下のGETで値を取得できます。
https://{CARTOのURL}/user/{関数を作成したユーザー名}/api/v2/sql?q=select+pg_size_pretty(pg_schema_size(%27{ユーザー名}%27))