Is it possible to store cstore_date on specified location? and cstore size

71 views
Skip to first unread message

Hiroyuki Sato

unread,
Nov 2, 2015, 8:39:11 AM11/2/15
to cstore users
Hello 

I have two questions.

1, Is it possible to store cstore_date on specified location?

  I tried following 

    SET default_tablespace = another_place;
    CREATE FOREIGN TABLE .. 

  But cstore_fdw data still stored on $PG_DATA/cstore_fdw.

  Current $PG_DATA area is too small so I would like to store another place.

2, How do I know file size specific cstore table ?

  Can I create cstore size query like the following?

    SELECT
      objname,
      to_char(pg_relation_size(objname::regclass), '999,999,999,999') as bytes
    FROM (
      SELECT
        tablename as objname
      FROM pg_tables
      WHERE schemaname = 'public'

      ) as objects

    ORDER BY bytes DESC

    I can calculate table size with following command.
    Any alternative idea?

      ls -l $PG_DATA/cstore_fdw/*

Best regards.

--
Hiroyuki Sato.

Murat Tuncer

unread,
Nov 2, 2015, 9:12:11 AM11/2/15
to Hiroyuki Sato, cstore users
Hi Hiroyuki

1 . you can create cstore_fdw data file on arbitrary folder, make sure user running postgres has write access to it.

when you create a cstore table use "filename" option like

create foreign table cstore_table
(
 ..... some fields here
) server cstore_server options (filename '/tmp/cstore_table_file');

2. select cstore_table_size() function returns the size of the cstore table in bytes like

select cstore_table_size('cstore_table');



--
You received this message because you are subscribed to the Google Groups "cstore users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cstore-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Murat Tuncer
Software Engineer | Citus Data
mtu...@citusdata.com

Hiroyuki Sato

unread,
Nov 2, 2015, 8:14:08 PM11/2/15
to cstore users, hiro...@gmail.com
Hello Murat.

Thank you for replying.
I'll try it.


2015年11月2日月曜日 23時12分11秒 UTC+9 Murat Tuncer:
Reply all
Reply to author
Forward
0 new messages