{"action":"created","issue":{"url":"https://api.github.com/repos/citusdata/cstore_fdw/issues/185","repository_url":"https://api.github.com/repos/citusdata/cstore_fdw","labels_url":"https://api.github.com/repos/citusdata/cstore_fdw/issues/185/labels{/name}","comments_url":"https://api.github.com/repos/citusdata/cstore_fdw/issues/185/comments","events_url":"https://api.github.com/repos/citusdata/cstore_fdw/issues/185/events","html_url":"https://github.com/citusdata/cstore_fdw/issues/185","id":318644883,"number":185,"title":"Setup for analytics data storage","user":{"login":"martinspaeth","id":4928482,"avatar_url":"https://avatars2.githubusercontent.com/u/4928482?v=4","gravatar_id":"","url":"https://api.github.com/users/martinspaeth","html_url":"https://github.com/martinspaeth","followers_url":"https://api.github.com/users/martinspaeth/followers","following_url":"https://api.github.com/users/martinspaeth/following{/other_user}","gists_url":"https://api.github.com/users/martinspaeth/gists{/gist_id}","starred_url":"https://api.github.com/users/martinspaeth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinspaeth/subscriptions","organizations_url":"https://api.github.com/users/martinspaeth/orgs","repos_url":"https://api.github.com/users/martinspaeth/repos","events_url":"https://api.github.com/users/martinspaeth/events{/privacy}","received_events_url":"https://api.github.com/users/martinspaeth/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-28T15:20:59Z","updated_at":"2018-04-30T06:45:28Z","closed_at":null,"author_association":"NONE","body":"Hi thank you for your great work at citusdata! We just setup a server with an cstore_fdw installation.\r\nThe initial copy of our table (around 80 milion data rows) into the foreign table took about 20 minutes. The query performance boost with the given approach is amazing! \r\nThe data in the origin table changes very rapidly (inserts and updates). While for our day to day analysis (which we plan to use the cstore for) 24 hour old data would be fresh enough i am not sure how the best practice for setting up a analytics only table with cstore should look like.\r\n\r\nMy current thougts are:\r\n1. setup a replica while the master has only a cstore installed (with an empty table) the replica shall fill the data in batches every 24 hours.\r\n  1.1. cause the initial fill of the table takes more than the max_standby_streaming_delay this seems to be kind of problematic \r\n2. like 1 but with triggers on the slave that would insert/update/delete records in the cstore \r\n 2.2. is not possible since cstore does only support insert \r\n\r\nThe setup with the trigger looks like the most up to date version and would take much less resources (assuming upserting/deleting would be not that expansive as a setup from scratch. \r\n\r\nIs there any input you can give me about best practices here or can you give me an update about the upsert/deletion functionality of cstore_fdw (discussed also in #2 #175 and last but not least in #118)\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/citusdata/cstore_fdw/issues/comments/385323062","html_url":"https://github.com/citusdata/cstore_fdw/issues/185#issuecomment-385323062","issue_url":"https://api.github.com/repos/citusdata/cstore_fdw/issues/185","id":385323062,"user":{"login":"mtuncer","id":9413470,"avatar_url":"https://avatars3.githubusercontent.com/u/9413470?v=4","gravatar_id":"","url":"https://api.github.com/users/mtuncer","html_url":"https://github.com/mtuncer","followers_url":"https://api.github.com/users/mtuncer/followers","following_url":"https://api.github.com/users/mtuncer/following{/other_user}","gists_url":"https://api.github.com/users/mtuncer/gists{/gist_id}","starred_url":"https://api.github.com/users/mtuncer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtuncer/subscriptions","organizations_url":"https://api.github.com/users/mtuncer/orgs","repos_url":"https://api.github.com/users/mtuncer/repos","events_url":"https://api.github.com/users/mtuncer/events{/privacy}","received_events_url":"https://api.github.com/users/mtuncer/received_events","type":"User","site_admin":false},"created_at":"2018-04-30T06:45:28Z","updated_at":"2018-04-30T06:45:28Z","author_association":"OWNER","body":"hello @martinspaeth \r\n\r\nOnce the data gets into cstore_fdw table it becomes immutable. Although there are issues calling to support update/delete, they are not planned to be done anytime soon. \r\n\r\nI have been recommending partitioned table approach who need this functionality.  It works for use cases when you only need to modify **RECENT** data.\r\n- create a master partitioned table (with no partitions)\r\n- insert your data into a regular staging table where you can make update/deletes.\r\n- when data in your staging table gets old enough, create cstore_fdw table as a partition of the master table, move old data from staging table to cstore table.\r\n\r\nNotice that, this is strictly for use cases when you only modify recent data, and you move data to cstore_fdw table only if you are sure you won't be modifying it anymore.\r\n\r\nThis approach also let's you selectively drop some cstore_fdw partition tables to retire old data.\r\n\r\nKeep in mind that, due to how postgres handles partition tables (as of 10),  you should insert data directly into cstore_fdw partition, not to the master partitioned table. It won't work otherwise.\r\n\r\n\r\n"}}
{"actor":{"display_login":"mtuncer"}}