{"id":79039,"date":"2020-04-23T19:43:26","date_gmt":"2020-04-23T17:43:26","guid":{"rendered":"https:\/\/prohoster.info\/blog\/administrirovanie\/ekonomim-kopeechku-na-bolshih-obemah-v-postgresql"},"modified":"2020-04-23T19:43:26","modified_gmt":"2020-04-23T17:43:26","slug":"ekonomim-kopeechku-na-bolshih-obemah-v-postgresql","status":"publish","type":"post","link":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/ekonomim-kopeechku-na-bolshih-obemah-v-postgresql","title":{"rendered":"Saving a penny on large volumes in PostgreSQL","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>Continuing the topic of recording large streams of data raised <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/497008\/\">in the previous article about partitioning<\/a><\/noindex>, in this one we will consider methods by which <b>you can reduce the 'physical' size of stored<\/b> data in PostgreSQL, and their impact on server performance.<\/p>\n<p>We will talk about <b>TOAST settings and data alignment.<\/b>. On average, these methods will save not too many resources, but without any modification of the application code.<\/p>\n<p><img decoding=\"async\" alt=\"Saving a penny on large volumes in PostgreSQL\" src=\"\/wp-content\/uploads\/2020\/04\/4d43b9b43edb10c4c8f13159c7dd1eac.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\nHowever, our experience turned out to be quite productive in this regard, as the storage for almost any monitoring is, by its nature, <b>mostly append-only<\/b> in terms of the data being written. And if you're curious about how to make the database write to disk instead of <b>200MB\/s<\/b> half that \u2014 please read on.<br \/>\n<noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><\/p>\n<h2>Little secrets of big data<\/h2>\n<p>\nAccording to the profile of our service, <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/487380\/\">it regularly receives text packets from logs.<\/a><\/noindex>And since <b>the IBS complex, whose databases we monitor, is a multi-component product with complex data structures, the queries<\/b>.<\/p>\n<p>to achieve maximum performance <noindex><a rel=\"nofollow\" href=\"https:\/\/sbis.ru\/all_services\">end up being quite<\/a><\/noindex>like 'multi-volume' with complex algorithmic logic. <b>Thus, the size of each individual query instance or the resulting execution plan in the incoming log turns out to be, on average, quite large.<\/b> Let's take a look at the structure of one of the tables where we write 'raw' data \u2014 that is, straight from the original log entry: <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/486072\/\">CREATE TABLE rawdata_orig(\n  pack -- PK\n    uuid NOT NULL\n, recno -- PK\n    smallint NOT NULL\n, dt -- section key\n    date\n, data -- the most important\n    text\n, PRIMARY KEY(pack, recno)\n);<\/a><\/noindex>A typical such table (already partitioned, of course, so this is a section template), where the most important part is the text. Sometimes it's quite large.<\/p>\n<p>Remember that the 'physical' size of a single record in PG cannot exceed one page of data, but the 'logical' size is a completely different matter. To write a large value (varchar\/text\/bytea) into a field, the<\/p>\n<pre><code class=\"sql\">TOAST technology is used.<\/code><\/pre>\n<p>\nA typical table like this (already partitioned, of course, so this is a section template), where the most important part is the text. Sometimes, it's quite extensive.<\/p>\n<p>Recall that the 'physical' size of a single entry in PG cannot exceed one data page, but the 'logical' size is a different matter. To write a large value in a field (varchar\/text\/bytea), the <noindex><a rel=\"nofollow\" href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/12\/storage-toast\">TOAST technology<\/a><\/noindex>:<\/p>\n<blockquote><p>PostgreSQL uses a fixed page size (usually 8 KB) and does not allow tuples to span multiple pages. Therefore, it is not possible to store very large field values directly. To overcome this limitation, large field values are compressed and\/or split into multiple physical rows. This happens transparently to the user and has a minimal impact on most of the server code. This method is known as TOAST \u2026<\/p><\/blockquote>\n<p>\nIn fact, for each table with 'potentially large' fields, a paired table with 'slices' is automatically <noindex><a rel=\"nofollow\" href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/12\/storage-toast#STORAGE-TOAST-ONDISK\">created for each 'large' record in segments of 2KB:<\/a><\/noindex> TOAST(\n  chunk_id\n    integer\n, chunk_seq\n    integer\n, chunk_data\n    bytea\n, PRIMARY KEY(chunk_id, chunk_seq)\n);<\/p>\n<pre><code class=\"sql\">That is, if we need to write a row with a 'large' value, the actual record will occur<\/code><\/pre>\n<p>\nnot only in the main table and its PK but also in TOAST and its PK. <code>data<\/code>Reducing TOAST impact <b>However, most records are not that large,<\/b>.<\/p>\n<h4>and should fit within 8KB.<\/h4>\n<p>\n\u2014 How can we save on this?.. <b>Here, the column attribute<\/b> STORAGE<\/p>\n<p>comes to our aid: <noindex><a rel=\"nofollow\" href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/12\/storage-toast#STORAGE-TOAST-ONDISK\"><code>EXTENDED<\/code><\/a><\/noindex> allows both compression and separate storage. This<\/p>\n<blockquote>\n<ul>\n<li><b>is the standard option<\/b> for most data types compatible with TOAST. First, an attempt is made to compress, then \u2014 to store outside the table if the row is still too large. <b>MAIN<\/b> allows compression but not separate storage. (In fact, separate storage will still be performed for such columns, but only<\/li>\n<li><b>as a last resort<\/b> , when there is no other way to reduce the row to fit on the page.) <b>In fact, this is exactly what we need for text \u2014<\/b>to maximize compression, and if it still doesn't fit \u2014 to move it to TOAST.<\/li>\n<\/ul>\n<\/blockquote>\n<p>This can be done right 'on the fly' with a single command: <b>ALTER TABLE rawdata_orig ALTER COLUMN data SET STORAGE MAIN;<\/b>How to assess the effect<\/p>\n<pre><code class=\"sql\">Since the data flow changes daily, we cannot compare absolute figures, but relatively, the smaller the proportion<\/code><\/pre>\n<p><\/p>\n<h4>we recorded in TOAST \u2014 the better. However, there is a danger \u2014 the larger the 'physical' volume of each individual record, the 'wider' the index becomes, as it has to cover a greater number of data pages.<\/h4>\n<p>\nBefore changes <b>heap  = 37GB (39%)\nTOAST = 54GB (57%)\nPK    =  4GB ( 4%)<\/b> After changes<\/p>\n<p>Section <b>heap  = 37GB (67%)\nTOAST = 16GB (29%)\nPK    =  2GB ( 4%)<\/b>:<\/p>\n<pre><code class=\"plaintext\">In fact, we\n<\/code><\/pre>\n<p>\nSection <b>have started writing to TOAST twice as infrequently.<\/b>:<\/p>\n<pre><code class=\"plaintext\">heap  = 37GB (67%)\nTOAST = 16GB (29%)\nPK    =  2GB ( 4%)<\/code><\/pre>\n<p>\nIn fact, we <b>have started writing to TOAST half as often<\/b>, which relieved not only the disk but also the CPU:<\/p>\n<p><img decoding=\"async\" alt=\"Saving a penny on large volumes in PostgreSQL\" src=\"\/wp-content\/uploads\/2020\/04\/547485eff9c6491ffe4d59e5c81f656d.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<img decoding=\"async\" alt=\"Saving a penny on large volumes in PostgreSQL\" src=\"\/wp-content\/uploads\/2020\/04\/6bd3b18146c20959693f961e41fff447.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\nI would note that we have also started to \u00abread\u00bb the disk less, not just \u00abwrite\u00bb \u2014 since when inserting a record into a table, we also have to \u00abread\u00bb part of the tree for each of the indexes to determine its future position in them.<\/p>\n<h2>Who lives well on PostgreSQL 11<\/h2>\n<p>\nAfter upgrading to PG11, we decided to continue the \u00abtuning\u00bb of TOAST and noted that starting from this version, the parameter became available for configuration <noindex><a rel=\"nofollow\" href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/11\/storage-toast#STORAGE-TOAST-ONDISK\"><code>toast_tuple_target<\/code><\/a><\/noindex>:<\/p>\n<blockquote><p>The TOAST processing code is triggered only when the value of the row that needs to be stored in the table exceeds the size of TOAST_TUPLE_THRESHOLD bytes (usually 2 KB). The TOAST code will compress and\/or move field values outside the table until the row value is less than TOAST_TUPLE_TARGET bytes (a variable size, usually also 2 KB) or further reduction is no longer possible.<\/p><\/blockquote>\n<p>We decided that our data are usually either \"quite short\" or \"very long\", so we decided to limit ourselves to the minimally possible value:<\/p>\n<pre><code class=\"sql\">ALTER TABLE rawplan_orig SET (toast_tuple_target = 128);<\/code><\/pre>\n<p>\nLet's see how the new settings affected disk load after readjustment:<\/p>\n<p><img decoding=\"async\" alt=\"Saving a penny on large volumes in PostgreSQL\" src=\"\/wp-content\/uploads\/2020\/04\/ccaa4879e413a566b362d01582eb8c19.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\nNot bad! The average <b>disk queue has decreased<\/b> by about 1.5 times, and the disk's occupancy \u2014 by 20%! But maybe this somehow affected the CPU?<\/p>\n<p><img decoding=\"async\" alt=\"Saving a penny on large volumes in PostgreSQL\" src=\"\/wp-content\/uploads\/2020\/04\/f7026e5809853d35c6fb7a8376b9f369.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\nAt least, it definitely did not get worse. Although, it's hard to judge if even such volumes still cannot raise the average CPU load above <b>5%<\/b>.<\/p>\n<h2>The sum changes when the terms are rearranged!<\/h2>\n<p>\nAs is known, a penny saves a ruble, and with our storage volumes of about <b>10TB\/month<\/b> even a slight optimization can provide a good profit. Therefore, we paid attention to the physical structure of our data \u2014 specifically how fields are <b>\"arranged\" within each record<\/b> of the tables.<\/p>\n<p>Because due to <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/company\/postgrespro\/blog\/444536\/\">data alignment<\/a><\/noindex> it directly <noindex><a rel=\"nofollow\" href=\"https:\/\/docs.gitlab.com\/ee\/development\/ordering_table_columns.html\">affects the resulting volume.<\/a><\/noindex>:<\/p>\n<blockquote><p>Many architectures provide for data alignment on machine word boundaries. For example, on a 32-bit x86 system, integers (type integer, occupying 4 bytes) will be aligned on a 4-byte word boundary, as will double-precision floating point numbers (type double precision, 8 bytes). On a 64-bit system, double values will be aligned on an 8-byte word boundary. This is yet another reason for incompatibility.<\/p>\n<p>Due to alignment, the size of a table row depends on the order of field placement. This effect is usually not very noticeable, but in some cases, it can lead to a significant increase in size. For example, if you mix fields of types char(1) and integer, there will typically be 3 unused bytes between them.<\/p><\/blockquote>\n<p>\nLet's start with synthetic models:<\/p>\n<pre><code class=\"sql\">SELECT pg_column_size(ROW(\n  '0000-0000-0000-0000-0000-0000-0000-0000'::uuid\n, 0::smallint\n, '2019-01-01'::date\n));\n-- 48 bytes\n\nSELECT pg_column_size(ROW(\n  '2019-01-01'::date\n, '0000-0000-0000-0000-0000-0000-0000-0000'::uuid\n, 0::smallint\n));\n-- 46 bytes<\/code><\/pre>\n<p>\nWhere did the extra bytes come from in the first case? It's simple \u2014 <b>the 2-byte smallint is aligned to a 4-byte boundary<\/b> before the next field, and when it stands last, there is nothing to align and no need to do so.<\/p>\n<p>In theory, everything is fine, and you can rearrange fields however you like. Let's check this with real data from one of the tables, whose daily section occupies about 10-15GB.<\/p>\n<p>Original structure:<\/p>\n<pre><code class=\"sql\">CREATE TABLE public.plan_20190220\n(\n-- Inherited from table plan:  pack uuid NOT NULL,\n-- Inherited from table plan:  recno smallint NOT NULL,\n-- Inherited from table plan:  host uuid,\n-- Inherited from table plan:  ts timestamp with time zone,\n-- Inherited from table plan:  exectime numeric(32,3),\n-- Inherited from table plan:  duration numeric(32,3),\n-- Inherited from table plan:  bufint bigint,\n-- Inherited from table plan:  bufmem bigint,\n-- Inherited from table plan:  bufdsk bigint,\n-- Inherited from table plan:  apn uuid,\n-- Inherited from table plan:  ptr uuid,\n-- Inherited from table plan:  dt date,\n  CONSTRAINT plan_20190220_pkey PRIMARY KEY (pack, recno),\n  CONSTRAINT chck_ptr CHECK (ptr IS NOT NULL),\n  CONSTRAINT plan_20190220_dt_check CHECK (dt = '2019-02-20'::date)\n)\nINHERITS (public.plan)<\/code><\/pre>\n<p>\nThe section after changing the order of columns has exactly <b>the same fields, just in a different order<\/b>:<\/p>\n<pre><code class=\"sql\">CREATE TABLE public.plan_20190221\n(\n-- Inherited from table plan:  dt date NOT NULL,\n-- Inherited from table plan:  ts timestamp with time zone,\n-- Inherited from table plan:  pack uuid NOT NULL,\n-- Inherited from table plan:  recno smallint NOT NULL,\n-- Inherited from table plan:  host uuid,\n-- Inherited from table plan:  apn uuid,\n-- Inherited from table plan:  ptr uuid,\n-- Inherited from table plan:  bufint bigint,\n-- Inherited from table plan:  bufmem bigint,\n-- Inherited from table plan:  bufdsk bigint,\n-- Inherited from table plan:  exectime numeric(32,3),\n-- Inherited from table plan:  duration numeric(32,3),\n  CONSTRAINT plan_20190221_pkey PRIMARY KEY (pack, recno),\n  CONSTRAINT chck_ptr CHECK (ptr IS NOT NULL),\n  CONSTRAINT plan_20190221_dt_check CHECK (dt = '2019-02-21'::date)\n)\nINHERITS (public.plan)<\/code><\/pre>\n<p>\nThe total section size is determined by the number of 'facts' and depends only on external processes, so we will divide the heap size (<code>pg_relation_size<\/code>) on the number of records in it \u2014 so we will obtain <b>the average size of an actual stored record<\/b>:<\/p>\n<p><img decoding=\"async\" alt=\"Saving a penny on large volumes in PostgreSQL\" src=\"\/wp-content\/uploads\/2020\/04\/06be2d7d70d223e7678f9a478e4c293f.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<b>Minus 6% of the volume<\/b>, great!<\/p>\n<p>But of course, it\u2019s not all that rosy \u2014 because <b>we can't change the order of fields in the indexes<\/b>, and therefore 'overall' (<code>pg_total_relation_size<\/code>)\u2026<\/p>\n<p><img decoding=\"async\" alt=\"Saving a penny on large volumes in PostgreSQL\" src=\"\/wp-content\/uploads\/2020\/04\/8beff38e5034fc0d40665b75cb3b3625.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n\u2026 still here <b>saved 1.5%<\/b>, without changing a single line of code. Indeed!<\/p>\n<p><img decoding=\"async\" alt=\"Saving a penny on large volumes in PostgreSQL\" src=\"\/wp-content\/uploads\/2020\/04\/10f4a2151465a38bf45823a5d360302b.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p>I should note that the above arrangement of fields is not necessarily the most optimal. Because some blocks of fields we don't want to 'split' for aesthetic reasons \u2014 for instance, a pair <code>(pack, recno)<\/code>, which serves as the PK for this table.<\/p>\n<p>Overall, defining the 'minimum' arrangement of fields is a relatively simple 'brute force' task. Therefore, you may achieve results even better than ours with your own data \u2014 give it a try!<br \/>\n<br \/>Source: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/company\/tensor\/blog\/498292\/\">habr.com<\/a> <\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044f \u0442\u0435\u043c\u0443 \u0437\u0430\u043f\u0438\u0441\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u0434\u043d\u044f\u0442\u0443\u044e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u043f\u0440\u043e \u0441\u0435\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0432 \u044d\u0442\u043e\u0439 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u00ab\u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0439\u00bb \u0440\u0430\u0437\u043c\u0435\u0440 \u0445\u0440\u0430\u043d\u0438\u043c\u043e\u0433\u043e \u0432 PostgreSQL, \u0438 \u0438\u0445 \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0420\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043f\u0440\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 TOAST \u0438 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u00ab\u0412 \u0441\u0440\u0435\u0434\u043d\u0435\u043c\u00bb \u044d\u0442\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442 \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u043d\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0437\u0430\u0442\u043e \u2014 \u0432\u043e\u043e\u0431\u0449\u0435 \u0431\u0435\u0437 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041e\u0434\u043d\u0430\u043a\u043e, [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":79040,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-79039","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.1.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044f \u0442\u0435\u043c\u0443 \u0437\u0430\u043f\u0438\u0441\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u0434\u043d\u044f\u0442\u0443\u044e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u043f\u0440\u043e \u0441\u0435\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0432 \u044d\u0442\u043e\u0439 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u043e\u0436\u043d\u043e.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/ekonomim-kopeechku-na-bolshih-obemah-v-postgresql\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.1.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u042d\u043a\u043e\u043d\u043e\u043c\u0438\u043c \u043a\u043e\u043f\u0435\u0435\u0447\u043a\u0443 \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0431\u044a\u0435\u043c\u0430\u0445 \u0432 PostgreSQL | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044f \u0442\u0435\u043c\u0443 \u0437\u0430\u043f\u0438\u0441\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u0434\u043d\u044f\u0442\u0443\u044e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u043f\u0440\u043e \u0441\u0435\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0432 \u044d\u0442\u043e\u0439 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u043e\u0436\u043d\u043e.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/ekonomim-kopeechku-na-bolshih-obemah-v-postgresql\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2020-04-23T17:43:26+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-04-23T17:43:26+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47We save a penny on large volumes in PostgreSQL | ProHoster","description":"Continuing the topic of recording large data streams raised in the previous article about partitioning, in this one we will look at the methods by which it can be done.","canonical_url":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/ekonomim-kopeechku-na-bolshih-obemah-v-postgresql","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u042d\u043a\u043e\u043d\u043e\u043c\u0438\u043c \u043a\u043e\u043f\u0435\u0435\u0447\u043a\u0443 \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0431\u044a\u0435\u043c\u0430\u0445 \u0432 PostgreSQL | ProHoster","og:description":"\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044f \u0442\u0435\u043c\u0443 \u0437\u0430\u043f\u0438\u0441\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u0434\u043d\u044f\u0442\u0443\u044e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u043f\u0440\u043e \u0441\u0435\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0432 \u044d\u0442\u043e\u0439 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u043e\u0436\u043d\u043e.","og:url":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/ekonomim-kopeechku-na-bolshih-obemah-v-postgresql","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2020-04-23T17:43:26+00:00","article:modified_time":"2020-04-23T17:43:26+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"79039","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":null,"breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-02-28 16:46:33","updated":"2022-09-28 06:02:32","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/79039","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/comments?post=79039"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/79039\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media\/79040"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media?parent=79039"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/categories?post=79039"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/tags?post=79039"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}