{"id":456239,"date":"2025-04-16T09:00:28","date_gmt":"2025-04-16T09:00:28","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=456239"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=456239","title":{"rendered":"<span>PostgreSQL Antipatterns: \u0441\u043e\u0437\u0434\u0430\u0435\u043c JSON \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u042f \u0443\u0436\u0435 \u043d\u0435 \u0440\u0430\u0437 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u043b \u0432 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u0442\u0435\u043c\u0443 [\u043d\u0435]\u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 <code>json[b]<\/code> \u0432 PostgreSQL &#8212; \u0438 \u043a\u0430\u043a \u0435\u0433\u043e \u043b\u0443\u0447\u0448\u0435 <a href=\"\/ru\/post\/771406\/\">\u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0432 \u0432\u044b\u0431\u043e\u0440\u043a\u0443<\/a>, \u0438 \u043a\u0430\u043a <a href=\"\/ru\/post\/850522\/\">\u043c\u043e\u0436\u043d\u043e &#171;\u0442\u0440\u0430\u043d\u0441\u043f\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c&#187;<\/a>. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043e \u0435\u0433\u043e <strong>\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b <\/strong>\u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0431\u0430\u0437\u044b.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 \u0441\u0435\u0440\u0438\u0438 &#171;\u043d\u0435 \u0441\u0443\u043f\u0435\u0440&#187; \u0432\u0437\u044f\u0442 \u0441 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0432 \u0430\u0440\u0445\u0438\u0432 \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430  \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043b\u0430\u043d\u043e\u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 <a href=\"https:\/\/explain.tensor.ru\/\">explain.tensor.ru<\/a>:<\/p>\n<pre><code class=\"sql\">SELECT   to_json(     json_build_object(       'team_id'     , team.team_id     , 'sport_id'     , team.sport_id     , 'team_name'     , team.team_name     , 'team_full'     , team.team_full     , 'team_url'     , team.team_url     , 'team_country'     , country.country_name     , 'country_id'     , team.country_id     , 'team_emblem'     , team.team_emblem     , 'download_date'     , team.download_date     , 'save_date'     , team.save_date     )   ) to_json_1 FROM   team JOIN   country     ON team.country_id = country.country_id<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0436\u0435 \u0432\u043e\u043f\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 &#8212; \u0430 \u0437\u0430\u0447\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c <code>to_json(json_build_object(...))<\/code>? \u0412\u0435\u0434\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>json_build_object<\/code>\u0438 \u0442\u0430\u043a \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 <code>json<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 &#8212; \u0437\u0430\u0447\u0435\u043c \u0435\u0433\u043e \u0435\u0449\u0435-\u0442\u043e \u0440\u0430\u0437 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0432 <code>json<\/code>? \u0412\u0438\u0434\u0438\u043c\u043e, \u044d\u0442\u043e \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u044b &#171;\u0434\u0430\u0432\u043d\u043e \u043c\u0438\u043d\u0443\u0432\u0448\u0438\u0445 \u0434\u043d\u0435\u0439&#187;&#8230;<\/p>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0434\u043b\u044f <code>json<\/code>-\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u043e \u0441\u0442\u0440\u043e\u043a\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0435 \u044d\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u043e \u043d\u0435\u0437\u0430\u0447\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0433\u0440\u0443\u0431\u043e \u043e\u0446\u0435\u043d\u0438\u043c \u0438\u0445 &#171;\u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0440\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c&#187; \u043d\u0430 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u0435 \u0441\u0442\u0440\u043e\u043a \u0432\u0441\u0435\u0433\u043e \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044f, \u0430 \u0437\u0430\u043e\u0434\u043d\u043e \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043c \u043f\u0440\u043e \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e &#8212; <code>row_to_json<\/code>.<\/p>\n<h4>json_build_object (1048ms)<\/h4>\n<pre><code class=\"sql\">EXPLAIN (ANALYZE, COSTS off) WITH T AS (   SELECT generate_series(1, 1e6) i ) SELECT   json_build_object('i', i) json FROM   T;<\/code><\/pre>\n<pre><code>Subquery Scan on t (actual time=0.010..1021.210 rows=1000000 loops=1)   -&gt;  ProjectSet (actual time=0.004..210.837 rows=1000000 loops=1)         -&gt;  Result (actual time=0.001..0.001 rows=1 loops=1) Planning Time: 0.052 ms Execution Time: 1048.717 ms<\/code><\/pre>\n<h4>to_json (833ms)<\/h4>\n<pre><code class=\"sql\">EXPLAIN (ANALYZE, COSTS off) WITH T AS (   SELECT generate_series(1, 1e6) i ) SELECT   to_json(T) json FROM   T;<\/code><\/pre>\n<pre><code>Subquery Scan on t (actual time=0.014..807.052 rows=1000000 loops=1)   -&gt;  ProjectSet (actual time=0.004..202.262 rows=1000000 loops=1)         -&gt;  Result (actual time=0.001..0.001 rows=1 loops=1) Planning Time: 0.057 ms Execution Time: 833.478 ms<\/code><\/pre>\n<h4>row_to_json (717ms)<\/h4>\n<pre><code class=\"sql\">EXPLAIN (ANALYZE, COSTS off) WITH T AS (   SELECT generate_series(1, 1e6) i ) SELECT   row_to_json(T) json FROM   T;<\/code><\/pre>\n<pre><code>Subquery Scan on t (actual time=0.012..690.754 rows=1000000 loops=1)   -&gt;  ProjectSet (actual time=0.004..190.792 rows=1000000 loops=1)         -&gt;  Result (actual time=0.001..0.001 rows=1 loops=1) Planning Time: 0.051 ms Execution Time: 717.296 ms<\/code><\/pre>\n<p>\u0417\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043d\u0435\u0437\u043d\u0430\u0447\u0430\u0449\u0438\u0445 \u043f\u0440\u043e\u0431\u0435\u043b\u043e\u0432 \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438 <code>json<\/code>, \u044d\u0442\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0434\u0430\u044e\u0442 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b, \u043d\u043e \u0437\u0430 \u043e\u0447\u0435\u043d\u044c \u0440\u0430\u0437\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"500\" width=\"500\">\n<p align=\"left\"><code>json_build_object<\/code><\/p>\n<\/td>\n<td data-colwidth=\"100\" width=\"100\">\n<p align=\"left\">1048ms<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"500\" width=\"500\">\n<p align=\"left\"><code>to_json<\/code><\/p>\n<\/td>\n<td data-colwidth=\"100\" width=\"100\">\n<p align=\"left\">833ms<\/p>\n<\/td>\n<td>\n<p align=\"left\">-21%<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"500\" width=\"500\">\n<p align=\"left\"><code>row_to_json<\/code><\/p>\n<\/td>\n<td data-colwidth=\"100\" width=\"100\">\n<p align=\"left\">717ms<\/p>\n<\/td>\n<td>\n<p align=\"left\">-32%<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0417\u0430\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u0430\u043c\u043e\u043c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u0441 <code>json_build_object<\/code> \u043d\u0430\u043c \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u0446\u0435\u043b\u0435\u0432\u044b\u0435 \u043f\u043e\u043b\u044f \u0438 \u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f &#171;\u0432\u0440\u0443\u0447\u043d\u0443\u044e&#187;, \u0447\u0442\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"sql\">SELECT   row_to_json(team) to_json_1 FROM   team JOIN   country     ON team.country_id = country.country_id<\/code><\/pre>\n<h2>\u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432<\/h2>\n<p>\u041f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c &#171;\u0432\u0441\u044e&#187; \u0437\u0430\u043f\u0438\u0441\u044c \u0432 <code>json<\/code> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438 \u043d\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0445\u043e\u0440\u043e\u0448, \u0435\u0441\u043b\u0438 \u0442\u0430\u043c \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 <strong>\u043e\u0431\u044a\u0435\u043c\u043d\u043e\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435<\/strong>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0435 \u0432\u043e\u0432\u0441\u0435 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430.<\/p>\n<h4>json_build_object \u043f\u043e \u043d\u0443\u0436\u043d\u044b\u043c \u043a\u043b\u044e\u0447\u0430\u043c (1148ms)<\/h4>\n<pre><code class=\"sql\">EXPLAIN (ANALYZE, COSTS off) WITH T AS (   SELECT     i   , repeat(' ', i::integer % 256) s   FROM     generate_series(1, 1e6) i ) SELECT   json_build_object('i', i) json FROM   T;<\/code><\/pre>\n<pre><code>Function Scan on generate_series i (actual time=235.115..1119.221 rows=1000000 loops=1) Planning Time: 0.063 ms Execution Time: 1148.314 ms<\/code><\/pre>\n<h4>to_jsonb &#8212; key (3705ms)<\/h4>\n<pre><code class=\"sql\">EXPLAIN (ANALYZE, COSTS off) WITH T AS (   SELECT     i   , repeat(' ', i::integer % 256) s   FROM     generate_series(1, 1e6) i ) SELECT   to_jsonb(T) - 's' json FROM   T;<\/code><\/pre>\n<pre><code>Function Scan on generate_series i (actual time=233.755..3650.783 rows=1000000 loops=1) Planning Time: 0.061 ms Execution Time: 3705.812 ms<\/code><\/pre>\n<p>\u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0437\u0430\u0431\u044b\u0442\u044c \u043f\u0440\u043e \u043d\u0430\u0448\u0435 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c <code>json<\/code>, \u0430 \u043d\u0435 <code>jsonb<\/code>, \u043a\u0430\u043a \u0442\u0443\u0442, \u0443\u0436\u0435 \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0448 2.5x \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<h4>row_to_json \u043f\u043e \u0432\u044b\u0431\u043e\u0440\u043a\u0435 (792ms)<\/h4>\n<p>\u041d\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u0441 \u0437\u0430\u043f\u0438\u0441\u044f\u043c\u0438, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0443\u0436\u043d\u044b\u0435 \u0434\u043b\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043a\u043b\u044e\u0447\u0438:<\/p>\n<pre><code class=\"sql\">EXPLAIN (ANALYZE, COSTS off) WITH T AS (   SELECT     i   , repeat(' ', i::integer % 256) s   FROM     generate_series(1, 1e6) i ) SELECT   row_to_json(T) json FROM   (     SELECT       i     FROM       T   ) T;<\/code><\/pre>\n<pre><code>Function Scan on generate_series i (actual time=233.817..762.789 rows=1000000 loops=1) Planning Time: 0.060 ms Execution Time: 792.618 ms<\/code><\/pre>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0443\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0432 PostgreSQL \u043f\u043e\u043a\u0430 \u0442\u0430\u043a \u0438 \u043d\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"493\" width=\"493\">\n<p align=\"left\"><code>json_build_object<\/code> \u043f\u043e \u043d\u0443\u0436\u043d\u044b\u043c \u043a\u043b\u044e\u0447\u0430\u043c<\/p>\n<\/td>\n<td data-colwidth=\"105\" width=\"105\">\n<p align=\"left\">1148ms<\/p>\n<\/td>\n<td>\n<p align=\"left\">-69%<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"493\" width=\"493\">\n<p align=\"left\"><code>to_jsonb - key<\/code><\/p>\n<\/td>\n<td data-colwidth=\"105\" width=\"105\">\n<p align=\"left\">3705ms<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"493\" width=\"493\">\n<p align=\"left\"><code>row_to_json<\/code> \u043f\u043e \u0432\u044b\u0431\u043e\u0440\u043a\u0435<\/p>\n<\/td>\n<td data-colwidth=\"105\" width=\"105\">\n<p align=\"left\">792ms<\/p>\n<\/td>\n<td>\n<p align=\"left\">-79%<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<hr\/>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0430\u0434\u043e \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c <code>json<\/code> &#8212; \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 <code>row_to_json<\/code>, \u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u0430\u043c \u0441\u0447\u0430\u0441\u0442\u044c\u0435, \u0430 \u0432\u0430\u0448\u0435\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u043e\u0431\u043b\u0435\u0433\u0447\u0435\u043d\u0438\u0435!<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/901216\/\"> https:\/\/habr.com\/ru\/articles\/901216\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u042f \u0443\u0436\u0435 \u043d\u0435 \u0440\u0430\u0437 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u043b \u0432 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u0442\u0435\u043c\u0443 [\u043d\u0435]\u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 <code>json[b]<\/code> \u0432 PostgreSQL &#8212; \u0438 \u043a\u0430\u043a \u0435\u0433\u043e \u043b\u0443\u0447\u0448\u0435 <a href=\"\/ru\/post\/771406\/\">\u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0432 \u0432\u044b\u0431\u043e\u0440\u043a\u0443<\/a>, \u0438 \u043a\u0430\u043a <a href=\"\/ru\/post\/850522\/\">\u043c\u043e\u0436\u043d\u043e &#171;\u0442\u0440\u0430\u043d\u0441\u043f\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c&#187;<\/a>. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043e \u0435\u0433\u043e <strong>\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b <\/strong>\u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0431\u0430\u0437\u044b.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 \u0441\u0435\u0440\u0438\u0438 &#171;\u043d\u0435 \u0441\u0443\u043f\u0435\u0440&#187; \u0432\u0437\u044f\u0442 \u0441 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0432 \u0430\u0440\u0445\u0438\u0432 \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430  \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043b\u0430\u043d\u043e\u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 <a href=\"https:\/\/explain.tensor.ru\/\">explain.tensor.ru<\/a>:<\/p>\n<pre><code class=\"sql\">SELECT   to_json(     json_build_object(       'team_id'     , team.team_id     , 'sport_id'     , team.sport_id     , 'team_name'     , team.team_name     , 'team_full'     , team.team_full     , 'team_url'     , team.team_url     , 'team_country'     , country.country_name     , 'country_id'     , team.country_id     , 'team_emblem'     , team.team_emblem     , 'download_date'     , team.download_date     , 'save_date'     , team.save_date     )   ) to_json_1 FROM   team JOIN   country     ON team.country_id = country.country_id<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0436\u0435 \u0432\u043e\u043f\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 &#8212; \u0430 \u0437\u0430\u0447\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c <code>to_json(json_build_object(...))<\/code>? \u0412\u0435\u0434\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>json_build_object<\/code>\u0438 \u0442\u0430\u043a \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 <code>json<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 &#8212; \u0437\u0430\u0447\u0435\u043c \u0435\u0433\u043e \u0435\u0449\u0435-\u0442\u043e \u0440\u0430\u0437 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0432 <code>json<\/code>? \u0412\u0438\u0434\u0438\u043c\u043e, \u044d\u0442\u043e \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u044b &#171;\u0434\u0430\u0432\u043d\u043e \u043c\u0438\u043d\u0443\u0432\u0448\u0438\u0445 \u0434\u043d\u0435\u0439&#187;&#8230;<\/p>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0434\u043b\u044f <code>json<\/code>-\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u043e \u0441\u0442\u0440\u043e\u043a\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0435 \u044d\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u043e \u043d\u0435\u0437\u0430\u0447\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0433\u0440\u0443\u0431\u043e \u043e\u0446\u0435\u043d\u0438\u043c \u0438\u0445 &#171;\u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0440\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c&#187; \u043d\u0430 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u0435 \u0441\u0442\u0440\u043e\u043a \u0432\u0441\u0435\u0433\u043e \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044f, \u0430 \u0437\u0430\u043e\u0434\u043d\u043e \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043c \u043f\u0440\u043e \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e &#8212; <code>row_to_json<\/code>.<\/p>\n<h4>json_build_object (1048ms)<\/h4>\n<pre><code class=\"sql\">EXPLAIN (ANALYZE, COSTS off) WITH T AS (   SELECT generate_series(1, 1e6) i ) SELECT   json_build_object('i', i) json FROM   T;<\/code><\/pre>\n<pre><code>Subquery Scan on t (actual time=0.010..1021.210 rows=1000000 loops=1)   -&gt;  ProjectSet (actual time=0.004..210.837 rows=1000000 loops=1)         -&gt;  Result (actual time=0.001..0.001 rows=1 loops=1) Planning Time: 0.052 ms Execution Time: 1048.717 ms<\/code><\/pre>\n<h4>to_json (833ms)<\/h4>\n<pre><code class=\"sql\">EXPLAIN (ANALYZE, COSTS off) WITH T AS (   SELECT generate_series(1, 1e6) i ) SELECT   to_json(T) json FROM   T;<\/code><\/pre>\n<pre><code>Subquery Scan on t (actual time=0.014..807.052 rows=1000000 loops=1)   -&gt;  ProjectSet (actual time=0.004..202.262 rows=1000000 loops=1)         -&gt;  Result (actual time=0.001..0.001 rows=1 loops=1) Planning Time: 0.057 ms Execution Time: 833.478 ms<\/code><\/pre>\n<h4>row_to_json (717ms)<\/h4>\n<pre><code class=\"sql\">EXPLAIN (ANALYZE, COSTS off) WITH T AS (   SELECT generate_series(1, 1e6) i ) SELECT   row_to_json(T) json FROM   T;<\/code><\/pre>\n<pre><code>Subquery Scan on t (actual time=0.012..690.754 rows=1000000 loops=1)   -&gt;  ProjectSet (actual time=0.004..190.792 rows=1000000 loops=1)         -&gt;  Result (actual time=0.001..0.001 rows=1 loops=1) Planning Time: 0.051 ms Execution Time: 717.296 ms<\/code><\/pre>\n<p>\u0417\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043d\u0435\u0437\u043d\u0430\u0447\u0430\u0449\u0438\u0445 \u043f\u0440\u043e\u0431\u0435\u043b\u043e\u0432 \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438 <code>json<\/code>, \u044d\u0442\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0434\u0430\u044e\u0442 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b, \u043d\u043e \u0437\u0430 \u043e\u0447\u0435\u043d\u044c \u0440\u0430\u0437\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"500\" width=\"500\">\n<p align=\"left\"><code>json_build_object<\/code><\/p>\n<\/td>\n<td data-colwidth=\"100\" width=\"100\">\n<p align=\"left\">1048ms<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"500\" width=\"500\">\n<p align=\"left\"><code>to_json<\/code><\/p>\n<\/td>\n<td data-colwidth=\"100\" width=\"100\">\n<p align=\"left\">833ms<\/p>\n<\/td>\n<td>\n<p align=\"left\">-21%<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"500\" width=\"500\">\n<p align=\"left\"><code>row_to_json<\/code><\/p>\n<\/td>\n<td data-colwidth=\"100\" width=\"100\">\n<p align=\"left\">717ms<\/p>\n<\/td>\n<td>\n<p align=\"left\">-32%<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0417\u0430\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u0430\u043c\u043e\u043c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u0441 <code>json_build_object<\/code> \u043d\u0430\u043c \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u0446\u0435\u043b\u0435\u0432\u044b\u0435 \u043f\u043e\u043b\u044f \u0438 \u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f &#171;\u0432\u0440\u0443\u0447\u043d\u0443\u044e&#187;, \u0447\u0442\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"sql\">SELECT   row_to_json(team) to_json_1 FROM   team JOIN   country     ON team.country_id = country.country_id<\/code><\/pre>\n<h2>\u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432<\/h2>\n<p>\u041f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c &#171;\u0432\u0441\u044e&#187; \u0437\u0430\u043f\u0438\u0441\u044c \u0432 <code>json<\/code> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438 \u043d\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0445\u043e\u0440\u043e\u0448, \u0435\u0441\u043b\u0438 \u0442\u0430\u043c \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 <strong>\u043e\u0431\u044a\u0435\u043c\u043d\u043e\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435<\/strong>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0435 \u0432\u043e\u0432\u0441\u0435 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430.<\/p>\n<h4>json_build_object \u043f\u043e \u043d\u0443\u0436\u043d\u044b\u043c \u043a\u043b\u044e\u0447\u0430\u043c (1148ms)<\/h4>\n<pre><code class=\"sql\">EXPLAIN (ANALYZE, COSTS off) WITH T AS (   SELECT     i   , repeat(' ', i::integer % 256) s   FROM     generate_series(1, 1e6) i ) SELECT   json_build_object('i', i) json FROM   T;<\/code><\/pre>\n<pre><code>Function Scan on generate_series i (actual time=235.115..1119.221 rows=1000000 loops=1) Planning Time: 0.063 ms Execution Time: 1148.314 ms<\/code><\/pre>\n<h4>to_jsonb &#8212; key (3705ms)<\/h4>\n<pre><code class=\"sql\">EXPLAIN (ANALYZE, COSTS off) WITH T AS (   SELECT     i   , repeat(' ', i::integer % 256) s   FROM     generate_series(1, 1e6) i ) SELECT   to_jsonb(T) - 's' json FROM   T;<\/code><\/pre>\n<pre><code>Function Scan on generate_series i (actual time=233.755..3650.783 rows=1000000 loops=1) Planning Time: 0.061 ms Execution Time: 3705.812 ms<\/code><\/pre>\n<p>\u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0437\u0430\u0431\u044b\u0442\u044c \u043f\u0440\u043e \u043d\u0430\u0448\u0435 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c <code>json<\/code>, \u0430 \u043d\u0435 <code>jsonb<\/code>, \u043a\u0430\u043a \u0442\u0443\u0442, \u0443\u0436\u0435 \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0448 2.5x \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<h4>row_to_json \u043f\u043e \u0432\u044b\u0431\u043e\u0440\u043a\u0435 (792ms)<\/h4>\n<p>\u041d\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u0441 \u0437\u0430\u043f\u0438\u0441\u044f\u043c\u0438, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0443\u0436\u043d\u044b\u0435 \u0434\u043b\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043a\u043b\u044e\u0447\u0438:<\/p>\n<pre><code class=\"sql\">EXPLAIN (ANALYZE, COSTS off) WITH T AS (   SELECT     i   , repeat(' ', i::integer % 256) s   FROM     generate_series(1, 1e6) i ) SELECT   row_to_json(T) json FROM   (     SELECT       i     FROM       T   ) T;<\/code><\/pre>\n<pre><code>Function Scan on generate_series i (actual time=233.817..762.789 rows=1000000 loops=1) Planning Time: 0.060 ms Execution Time: 792.618 ms<\/code><\/pre>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0443\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0432 PostgreSQL \u043f\u043e\u043a\u0430 \u0442\u0430\u043a \u0438 \u043d\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"493\" width=\"493\">\n<p align=\"left\"><code>json_build_object<\/code> \u043f\u043e \u043d\u0443\u0436\u043d\u044b\u043c \u043a\u043b\u044e\u0447\u0430\u043c<\/p>\n<\/td>\n<td data-colwidth=\"105\" width=\"105\">\n<p align=\"left\">1148ms<\/p>\n<\/td>\n<td>\n<p align=\"left\">-69%<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"493\" width=\"493\">\n<p align=\"left\"><code>to_jsonb - key<\/code><\/p>\n<\/td>\n<td data-colwidth=\"105\" width=\"105\">\n<p align=\"left\">3705ms<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"493\" width=\"493\">\n<p align=\"left\"><code>row_to_json<\/code> \u043f\u043e \u0432\u044b\u0431\u043e\u0440\u043a\u0435<\/p>\n<\/td>\n<td data-colwidth=\"105\" width=\"105\">\n<p align=\"left\">792ms<\/p>\n<\/td>\n<td>\n<p align=\"left\">-79%<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<hr\/>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0430\u0434\u043e \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c <code>json<\/code> &#8212; \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 <code>row_to_json<\/code>, \u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u0430\u043c \u0441\u0447\u0430\u0441\u0442\u044c\u0435, \u0430 \u0432\u0430\u0448\u0435\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u043e\u0431\u043b\u0435\u0433\u0447\u0435\u043d\u0438\u0435!<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/901216\/\"> https:\/\/habr.com\/ru\/articles\/901216\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-456239","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/456239","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=456239"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/456239\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=456239"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=456239"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=456239"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}