{"id":482557,"date":"2026-06-05T15:07:03","date_gmt":"2026-06-05T15:07:03","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=482557"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=482557","title":{"rendered":"\u041f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0435 SQL-\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432\u043c\u0435\u0441\u0442\u043e GraphQL \u0434\u043b\u044f \u0433\u0440\u0430\u0444\u0430 \u0437\u043d\u0430\u043d\u0438\u0439"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h3>\u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442<\/h3>\n<p>\u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c wiki \u043f\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430\u043c \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u2014 72 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0435\u0441\u044f \u0432 AlloyDB Omni (PostgreSQL 16.11) \u0441 pgvector \u0434\u043b\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430. \u041c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0433\u0440\u0430\u0444 \u0437\u043d\u0430\u043d\u0438\u0439: \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0440\u0451\u0431\u0440\u0430 \u043c\u0435\u0436\u0434\u0443 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u043c\u0438, 11 \u0442\u0438\u043f\u043e\u0432 \u0441\u0432\u044f\u0437\u0435\u0439, \u0432\u0435\u0441\u043e\u0432\u044b\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b. \u0413\u0440\u0430\u0444 \u043e\u0431\u043e\u0433\u0430\u0442\u0438\u043b retrieval: recall \u0432\u044b\u0440\u043e\u0441 \u0441 46.7% \u0434\u043e 68.3%.<\/p>\n<p>Google \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043b <a href=\"https:\/\/github.com\/GoogleCloudPlatform\/cloud-spanner-samples\/tree\/main\/context-graph-on-spanner\" rel=\"noopener noreferrer nofollow\">context-graph-on-spanner<\/a> \u2014 \u0440\u0435\u0444\u0435\u0440\u0435\u043d\u0441\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u0433\u043e \u0433\u0440\u0430\u0444\u0430 \u043d\u0430 Cloud Spanner \u0441 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c Property Graph \u0438 GQL (Graph Query Language). \u0412\u043e\u0437\u043d\u0438\u043a \u0432\u043e\u043f\u0440\u043e\u0441: \u0441\u0442\u043e\u0438\u0442 \u043b\u0438 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u043d\u0430\u0448 \u0433\u0440\u0430\u0444 \u043d\u0430 Spanner \u0441 \u0435\u0433\u043e \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u0433\u0440\u0430\u0444\u043e\u0432? \u0418\u043b\u0438 \u043e\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u043d\u0430 AlloyDB?<\/p>\n<p>\u041c\u044b \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u043d\u0430 AlloyDB. \u0412\u043e\u0442 \u043f\u043e\u0447\u0435\u043c\u0443.<\/p>\n<hr\/>\n<h3>\u0414\u0432\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043a \u0433\u0440\u0430\u0444\u0443<\/h3>\n<h4>Spanner: Property Graph + GQL<\/h4>\n<p>Spanner \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 7.0+ \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 Property Graph \u2014 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u0433\u0440\u0430\u0444\u0430 \u043f\u043e\u0432\u0435\u0440\u0445 \u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0442\u0430\u0431\u043b\u0438\u0446:<\/p>\n<pre><code class=\"sql\">CREATE PROPERTY GRAPH MarketingContextGraph  NODE TABLES (Customers, Decisions, Policies, Outcomes)  EDGE TABLES (    AboutCustomer      SOURCE KEY (decision_id) REFERENCES Decisions (decision_id)      DESTINATION KEY (customer_id) REFERENCES Customers (customer_id),    FollowedPolicy      SOURCE KEY (decision_id) REFERENCES Decisions (decision_id)      DESTINATION KEY (policy_id) REFERENCES Policies (policy_id),    ResultedIn      SOURCE KEY (decision_id) REFERENCES Decisions (decision_id)      DESTINATION KEY (outcome_id) REFERENCES Outcomes (outcome_id)  );<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0417\u0430\u043f\u0440\u043e\u0441\u044b \u2014 \u043d\u0430 GQL, \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d-\u043c\u0430\u0442\u0447\u0438\u043d\u0433\u0430:<\/p>\n<pre><code class=\"sql\">GRAPH MarketingContextGraphMATCH (c:Customers {industry: $1, tier: $2})&lt;-[:AboutCustomer]-(d:Decisions {signal_type: $3})-[:ResultedIn]-&gt;(o:Outcomes)WHERE o.result = 'Renewed'RETURN d.decision_type AS Action_Type, d.reasoning_text AS Success_LogicORDER BY d.timestamp DESCLIMIT 3<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041a\u0440\u0430\u0441\u0438\u0432\u043e. \u041b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u043e. \u041f\u0430\u0442\u0442\u0435\u0440\u043d-\u043c\u0430\u0442\u0447\u0438\u043d\u0433: \u00ab\u043d\u0430\u0439\u0434\u0438 \u043c\u043d\u0435 \u0432\u0441\u0435 \u043f\u0443\u0442\u0438 Decision \u2192 Customer \u2190 Decision \u2192 Outcome, \u0433\u0434\u0435 outcome = Renewed\u00bb. \u041e\u0434\u043d\u0430 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f <code>MATCH<\/code> \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 20 \u0441\u0442\u0440\u043e\u043a SQL-\u0434\u0436\u043e\u0439\u043d\u043e\u0432.<\/p>\n<h4>AlloyDB: \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0435 CTE<\/h4>\n<p>\u0423 \u043d\u0430\u0441 \u043d\u0435\u0442 GQL. \u041d\u043e \u0435\u0441\u0442\u044c <code>WITH RECURSIVE<\/code> \u2014 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c PostgreSQL \u0434\u043b\u044f \u043e\u0431\u0445\u043e\u0434\u0430 \u0433\u0440\u0430\u0444\u043e\u0432:<\/p>\n<pre><code class=\"sql\">CREATE OR REPLACE FUNCTION graph_neighbors(  _label TEXT, _kind TEXT DEFAULT NULL,  _depth INT DEFAULT 1, _limit INT DEFAULT 20)RETURNS TABLE (node_label TEXT, node_kind TEXT, edge_kind TEXT, depth INT, wiki_path TEXT) AS $$WITH RECURSIVE traverse(id, node_label, node_kind, wiki_path, edge_kind, depth) AS (  -- Anchor: \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u044f \u043d\u043e\u0434\u0430  SELECT n.id, n.label, n.kind, n.wiki_path, NULL, 0  FROM graph_nodes n WHERE n.label = _label  UNION ALL  -- Recursive step: \u043e\u0431\u0445\u043e\u0434 \u043f\u043e \u0440\u0451\u0431\u0440\u0430\u043c \u0432 \u043e\u0431\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u044b  SELECT COALESCE(t.id, s.id), COALESCE(t.label, s.label),         COALESCE(t.kind, s.kind), COALESCE(t.wiki_path, s.wiki_path),         e.kind, p.depth + 1  FROM traverse p  JOIN graph_edges e ON (e.source_id = p.id OR e.target_id = p.id)  LEFT JOIN graph_nodes t ON t.id = e.target_id AND e.source_id = p.id  LEFT JOIN graph_nodes s ON s.id = e.source_id AND e.target_id = p.id  WHERE p.depth &lt; _depth    AND (COALESCE(t.id, s.id) IS NOT NULL)    AND (_kind IS NULL OR e.kind = _kind))SELECT DISTINCT ON (node_label) node_label, node_kind, edge_kind, depth, wiki_pathFROM traverse WHERE depth &gt; 0 ORDER BY node_label, depth LIMIT _limit;$$ LANGUAGE sql STABLE;<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0413\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u043e? \u0414\u0430. \u041d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<hr\/>\n<h3>\u041f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u043d\u0430 SQL: \u043f\u044f\u0442\u044c \u043f\u0440\u0438\u0447\u0438\u043d<\/h3>\n<h4>1. \u041e\u0434\u043d\u0430 \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043c\u0435\u0441\u0442\u043e \u0434\u0432\u0443\u0445<\/h4>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c AlloyDB \u0443\u0436\u0435 \u0436\u0438\u0432\u0443\u0442:<\/p>\n<ul>\n<li>\n<p><code>wiki_pages<\/code> \u2014 \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446<\/p>\n<\/li>\n<li>\n<p><code>graph_nodes<\/code> \u0441 pgvector \u2014 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0438 \u0434\u043b\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430<\/p>\n<\/li>\n<li>\n<p><code>graph_edges<\/code> \u2014 \u0440\u0451\u0431\u0440\u0430 \u0433\u0440\u0430\u0444\u0430 \u0437\u043d\u0430\u043d\u0438\u0439<\/p>\n<\/li>\n<li>\n<p><code>ai.generate()<\/code> \u2014 \u0432\u044b\u0437\u043e\u0432 Gemini \u043f\u0440\u044f\u043c\u043e \u0438\u0437 SQL<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u0433\u0440\u0430\u0444\u0430 \u043d\u0430 Spanner \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442: \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0432 AlloyDB, \u0433\u0440\u0430\u0444 \u0432 Spanner, \u0442\u0435\u043a\u0441\u0442 \u0432 AlloyDB. \u041a\u0430\u0436\u0434\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u2014 join \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u0431\u0430\u0437\u0430\u043c\u0438. \u042d\u0442\u043e \u043d\u0435 \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u0435, \u0430 \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u0438\u0435.<\/p>\n<p>\u041d\u0430 Spanner-\u0441\u044d\u043c\u043f\u043b\u0435 \u0433\u0440\u0430\u0444 \u0438 \u0442\u0430\u043a \u0436\u0438\u0432\u0451\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u2014 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0443 \u043d\u0438\u0445 \u043d\u0435\u0442 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0432 Spanner. \u041d\u043e \u0443 \u043d\u0430\u0441 \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0443\u0436\u0435 \u0432 AlloyDB. \u0420\u0430\u0437\u0440\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u043e\u0442 \u0433\u0440\u0430\u0444\u0430 \u2014 \u0448\u0430\u0433 \u043d\u0430\u0437\u0430\u0434.<\/p>\n<h4>2. \u0413\u0438\u0431\u0440\u0438\u0434\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u043e\u0434\u043d\u043e\u043c SQL<\/h4>\n<p>\u041d\u0430\u0448\u0430 \u043a\u043b\u044e\u0447\u0435\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u2014 <code>graph_context_for_query<\/code> \u2014 \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u0438 \u0433\u0440\u0430\u0444\u043e\u0432\u044b\u0439 \u043e\u0431\u0445\u043e\u0434 <strong>\u0432 \u043e\u0434\u043d\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435<\/strong>:<\/p>\n<pre><code class=\"sql\">WITH seeds AS (  -- \u0412\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u2192 5 seed-\u043d\u043e\u0434  SELECT n.id, n.wiki_path, 1 - (n.embedding &lt;=&gt; _embedding) AS sim  FROM graph_nodes n ORDER BY n.embedding &lt;=&gt; _embedding LIMIT $2),hops AS (  -- Seed \u2192 hop 1 (\u043f\u0440\u044f\u043c\u044b\u0435 \u0441\u043e\u0441\u0435\u0434\u0438)  SELECT nb.id, nb.wiki_path, ... FROM seeds s  JOIN graph_edges e ON e.source_id = s.id  JOIN graph_nodes nb ON nb.id = e.target_id  UNION ALL  -- Seed \u2192 hop 2 (\u0441\u043e\u0441\u0435\u0434\u0438 \u0441\u043e\u0441\u0435\u0434\u0435\u0439)  SELECT nb2.id, nb2.wiki_path, ... FROM seeds s  JOIN graph_edges e ON e.source_id = s.id  JOIN graph_edges e2 ON e2.source_id = e.target_id  JOIN graph_nodes nb2 ON nb2.id = e2.target_id)SELECT ... FROM hops JOIN wiki_pages wp ON wp.path = h.wiki_path;<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412\u0435\u043a\u0442\u043e\u0440 \u043d\u0430\u0448\u0451\u043b seed-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. \u0413\u0440\u0430\u0444 \u0440\u0430\u0441\u043a\u0440\u044b\u043b \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043d\u0430 2 \u043f\u0440\u044b\u0436\u043a\u0430. Edge weights \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u044e\u0442 \u0432 \u0440\u0430\u043d\u0436\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2014 \u043e\u0434\u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441 <code>rank_score = similarity \u00d7 edge_weight \/ (depth + 1)<\/code>.<\/p>\n<p>\u041d\u0430 Spanner \u044d\u0442\u043e \u0434\u0432\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u0430: \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u0432 \u043e\u0434\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0435, GQL-\u0437\u0430\u043f\u0440\u043e\u0441 \u2014 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c. \u0421\u043a\u043b\u0435\u0438\u0432\u0430\u0442\u044c \u2014 \u0432 \u043a\u043e\u0434\u0435 \u0430\u0433\u0435\u043d\u0442\u0430.<\/p>\n<h4>3. ai.generate() \u0438\u0437 SQL \u2014 Killer Feature<\/h4>\n<p>AlloyDB \u0441 <code>google_ml_integration \u2265 1.5.2<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c Gemini \u043f\u0440\u044f\u043c\u043e \u0438\u0437 plpgsql:<\/p>\n<pre><code class=\"sql\">_result := ai.generate(_prompt);<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u044d\u0442\u043e \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0440\u0451\u0431\u0435\u0440: 205 \u043d\u0435\u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 <code>mentions<\/code>-\u0440\u0451\u0431\u0435\u0440 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0442\u0438\u043f\u044b (depends_on, develops, based_on) \u0437\u0430 <strong>$0.01<\/strong> \u043d\u0430 \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0433\u043e\u043d. \u0411\u0435\u0437 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u044f, \u0431\u0435\u0437 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430-\u0438\u043c\u043f\u043e\u0440\u0442\u0430.<\/p>\n<p>Spanner \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e <code>ai.generate()<\/code>. \u041a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0440\u0451\u0431\u0435\u0440 \u2014 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442.<\/p>\n<h4>4. \u0422\u0430\u0431\u043b\u0438\u0446\u0430 edge types \u2014 \u0433\u0438\u0431\u0447\u0435, \u0447\u0435\u043c Property Graph DDL<\/h4>\n<p>Spanner \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0440\u0435\u0431\u0440\u0430:<\/p>\n<pre><code class=\"sql\">CREATE TABLE AboutCustomer (decision_id ..., customer_id ...) PRIMARY KEY (decision_id, customer_id);CREATE TABLE FollowedPolicy (decision_id ..., policy_id ...) PRIMARY KEY (decision_id, policy_id);CREATE TABLE ResultedIn (decision_id ..., outcome_id ...) PRIMARY KEY (decision_id, outcome_id);<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0422\u0440\u0438 \u0442\u0438\u043f\u0430 \u0440\u0451\u0431\u0435\u0440 \u2014 \u0442\u0440\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b. \u0423 \u043d\u0430\u0441 11 \u0442\u0438\u043f\u043e\u0432 \u2014 \u044d\u0442\u043e 11 \u0442\u0430\u0431\u043b\u0438\u0446? \u0418\u043b\u0438 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u0430\u044f <code>graph_edges<\/code> \u0441 <code>kind<\/code>?<\/p>\n<p>\u0423 \u043d\u0430\u0441 \u2014 \u043e\u0434\u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 <code>graph_edges<\/code> \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u043c \u043f\u043e\u043b\u0435\u043c <code>kind<\/code>. \u0425\u043e\u0447\u0435\u0448\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0442\u0438\u043f \u0440\u0435\u0431\u0440\u0430 \u2014 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c DDL, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e <code>INSERT<\/code> \u0441 \u043d\u043e\u0432\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c <code>kind<\/code>. \u042d\u0442\u043e \u0432\u0430\u0436\u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0441\u0442\u0443\u0449\u0435\u0439 wiki, \u0433\u0434\u0435 \u0442\u0438\u043f\u044b \u0441\u0432\u044f\u0437\u0435\u0439 \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u044e\u0442.<\/p>\n<p>Spanner-\u043f\u043e\u0434\u0445\u043e\u0434 \u0441\u0442\u0440\u043e\u0436\u0435, \u043d\u043e \u0436\u0451\u0441\u0442\u0447\u0435. \u0414\u043b\u044f enterprise-\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0441\u0445\u0435\u043c\u043e\u0439 \u2014 \u043e\u0442\u043b\u0438\u0447\u043d\u043e. \u0414\u043b\u044f \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 wiki, \u0433\u0434\u0435 \u043c\u044b \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u044b\u0435 \u0442\u0438\u043f\u044b \u2014 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043d\u0435\u0433\u0438\u0431\u043a\u043e.<\/p>\n<h4>5. \u0421\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b<\/h4>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0410\u0441\u043f\u0435\u043a\u0442<\/p>\n<\/th>\n<th>\n<p align=\"left\">Spanner + GQL<\/p>\n<\/th>\n<th>\n<p align=\"left\">AlloyDB + SQL<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>\u0411\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">Spanner ($$$, \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441)<\/p>\n<\/td>\n<td>\n<p align=\"left\">AlloyDB Omni (\u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043d\u0430\u0448\u0435\u043c VPS)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>\u0412\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041d\u0443\u0436\u0435\u043d \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 (Vertex AI Matching Engine)<\/p>\n<\/td>\n<td>\n<p align=\"left\">pgvector \u0432 \u0442\u043e\u0439 \u0436\u0435 \u0411\u0414<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>LLM \u0438\u0437 \u0411\u0414<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041d\u0435\u0442<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>ai.generate()<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>\u0413\u0440\u0430\u0444\u043e\u0432\u044b\u0439 \u044f\u0437\u044b\u043a<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">GQL (\u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439)<\/p>\n<\/td>\n<td>\n<p align=\"left\">WITH RECURSIVE (\u0438\u043c\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0432\u0435\u043a\u0442\u043e\u0440 + \u0433\u0440\u0430\u0444<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0412 \u043a\u043e\u0434\u0435 \u0430\u0433\u0435\u043d\u0442\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0412 \u043e\u0434\u043d\u043e\u043c SQL-\u0437\u0430\u043f\u0440\u043e\u0441\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>\u041d\u043e\u0432\u044b\u0435 \u0442\u0438\u043f\u044b \u0440\u0451\u0431\u0435\u0440<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041d\u043e\u0432\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 + DDL<\/p>\n<\/td>\n<td>\n<p align=\"left\">INSERT \u0441 \u043d\u043e\u0432\u044b\u043c kind<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">~$100\/\u043c\u0435\u0441 (Spanner instance)<\/p>\n<\/td>\n<td>\n<p align=\"left\">$0 (\u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0414\u043b\u044f \u0441\u0442\u0430\u0440\u0442\u0430\u043f\u0430\/\u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u00ab<img decoding=\"async\" class=\"formula inline\" source=\"0 \u043f\u043e\u0432\u0435\u0440\u0445 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b\u00bb \u0438 \u00ab\" alt=\"0 \u043f\u043e\u0432\u0435\u0440\u0445 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b\u00bb \u0438 \u00ab\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/32\/323\/323f5bbdd60ecbb2f013b36352157e4a.svg\" width=\"384\" height=\"16\" data-width=\"48.643\" data-height=\"2.149\" data-vertical-align=\"-0.452\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/32\/323\/323f5bbdd60ecbb2f013b36352157e4a.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/32\/323\/323f5bbdd60ecbb2f013b36352157e4a.svg 781w\" loading=\"lazy\" decode=\"async\"\/>100\/\u043c\u0435\u0441 \u0437\u0430 \u043d\u043e\u0432\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441\u00bb \u2014 \u044d\u0442\u043e \u043d\u0435 \u0432\u043e\u043f\u0440\u043e\u0441 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u0439, \u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u0432\u044b\u0436\u0438\u0432\u0430\u043d\u0438\u044f.<\/p>\n<hr\/>\n<h3>\u0427\u0435\u0433\u043e \u043d\u0430\u043c \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0431\u0435\u0437 GQL<\/h3>\n<p>\u0427\u0435\u0441\u0442\u043d\u043e \u2014 \u0435\u0441\u0442\u044c \u0432\u0435\u0449\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 GQL \u0434\u0435\u043b\u0430\u0435\u0442 \u043b\u0443\u0447\u0448\u0435:<\/p>\n<p><strong>\u041f\u0430\u0442\u0442\u0435\u0440\u043d-\u043c\u0430\u0442\u0447\u0438\u043d\u0433.<\/strong> \u0417\u0430\u043f\u0440\u043e\u0441 \u00ab\u043d\u0430\u0439\u0434\u0438 \u0432\u0441\u0435 \u043f\u0443\u0442\u0438 A \u2192 B \u2192 C, \u0433\u0434\u0435 B \u2014 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0442\u0438\u043f\u00bb \u043d\u0430 GQL \u2014 \u043e\u0434\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0430 <code>MATCH<\/code>. \u041d\u0430 SQL \u2014 \u0434\u0432\u0430 <code>JOIN<\/code> + <code>WITH RECURSIVE<\/code> + \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u0443\u0442\u044c. \u041a\u043e\u0434 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u0438\u043d\u043d\u0435\u0435 \u0438 \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f.<\/p>\n<p><strong>\u0414\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043e\u0431\u0445\u043e\u0434.<\/strong> GQL \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0431\u0445\u043e\u0434\u0438\u0442 \u0433\u0440\u0430\u0444 \u0432 \u043e\u0431\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u044b: <code>()-[]-()<\/code> \u0431\u0435\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0412 \u043d\u0430\u0448\u0435\u043c SQL \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c <code>e.source_id = p.id OR e.target_id = p.id<\/code> \u0441 <code>COALESCE<\/code> \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u043a\u0430\u043a\u0430\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u0430 \u2014 \u0441\u043e\u0441\u0435\u0434.<\/p>\n<p><strong>\u0427\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c.<\/strong> GQL-\u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442 \u043b\u044e\u0431\u043e\u0439, \u043a\u0442\u043e \u0437\u043d\u0430\u043a\u043e\u043c \u0441 Cypher (Neo4j). SQL-\u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043d\u0430 30 \u0441\u0442\u0440\u043e\u043a \u0441 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0435\u0439 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c.<\/p>\n<p>\u041d\u043e \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e use case \u2014 \u0433\u0440\u0430\u0444 \u0441 72 \u043d\u043e\u0434\u0430\u043c\u0438 \u0438 215 \u0440\u0451\u0431\u0440\u0430\u043c\u0438, \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0439 2-3 \u0430\u0433\u0435\u043d\u0442\u0430 \u2014 \u044d\u0442\u043e \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u0430\u044f \u043c\u043e\u0449\u044c. SQL \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f.<\/p>\n<hr\/>\n<h3>\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430\u0448 retrieval pipeline<\/h3>\n<p>\u0414\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0442\u044b \u043a\u0430\u0440\u0442\u0438\u043d\u044b \u2014 \u0432\u0435\u0441\u044c \u043f\u0443\u0442\u044c \u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0434\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430:<\/p>\n<pre><code>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442: \u00ab\u041a\u0430\u043a \u0441\u0432\u044f\u0437\u0430\u043d\u044b MesaNet \u0438 Titans?\u00bb        \u2502        \u25bc1. getEmbedding(query) \u2192 Vertex AI \u2192 768-\u043c\u0435\u0440\u043d\u044b\u0439 \u0432\u0435\u043a\u0442\u043e\u0440        \u2502        \u25bc2. graph_context_for_query(embedding, top_k=5, hop_depth=1)   \u2502   \u251c\u2500 \u0412\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a: 5 seed-\u0441\u0442\u0440\u0430\u043d\u0438\u0446 (MesaNet, Titans, NLM, ...)   \u2502   \u251c\u2500 Hop 1: \u0441\u043e\u0441\u0435\u0434\u0438 seed-\u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u043f\u043e \u0433\u0440\u0430\u0444\u0443   \u2502  \u2192 graph_edges JOIN graph_nodes   \u2502  \u2192 edge_weight: depends_on=0.95, mentions=0.3   \u2502   \u251c\u2500 rank_score = similarity \u00d7 edge_weight \/ (depth + 1)   \u2502   \u2514\u2500 JOIN wiki_pages \u2192 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446        \u2502        \u25bc3. MCP-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 wiki_graph_context \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442:[seed] MesaNet (sim=0.82)[seed] Titans (sim=0.78)[hop1] Surrogate Memory (via based_on, rank=0.62)[hop1] Memory as Context (via develops, rank=0.55)[hop2] Fast Weight Programmers (via depends_on, rank=0.31)        \u2502        \u25bc4. LLM-\u0430\u0433\u0435\u043d\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442   \u0438 \u0441\u0442\u0440\u043e\u0438\u0442 \u043e\u0442\u0432\u0435\u0442 \u0441\u043e \u0441\u0441\u044b\u043b\u043a\u0430\u043c\u0438 \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0442\u044b<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<hr\/>\n<h3>\u0413\u0434\u0435 GQL \u0431\u044b\u043b \u0431\u044b \u043a\u0441\u0442\u0430\u0442\u0438<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0431\u044b wiki \u0432\u044b\u0440\u043e\u0441\u043b\u0430 \u0434\u043e \u0441\u043e\u0442\u0435\u043d \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0438 \u0434\u0435\u0441\u044f\u0442\u043a\u043e\u0432 \u0430\u0433\u0435\u043d\u0442\u043e\u0432 \u2014 Spanner + GQL \u0441\u0442\u0430\u043b \u0431\u044b \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d:<\/p>\n<ul>\n<li>\n<p><strong>\u0411\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b:<\/strong> \u00ab\u043d\u0430\u0439\u0434\u0438 \u0432\u0441\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 X, \u043d\u043e \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0430\u0442 Y, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c Y \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 Z\u00bb \u2014 \u043d\u0430 GQL \u044d\u0442\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 MATCH, \u043d\u0430 SQL \u2014 \u043a\u0430\u0441\u043a\u0430\u0434 CTE.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c:<\/strong> Spanner \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u0433\u0440\u0430\u0444\u043e\u0432\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0433\u0440\u0430\u0444\u0430\u0445. CTE \u043d\u0430 10 000+ \u043d\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0447\u0430\u0442\u044c \u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442\u044c.<\/p>\n<\/li>\n<li>\n<p><strong>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0430\u0446\u0438\u044f:<\/strong> GQL \u2014 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 ISO (GQL\/ISO 39075). SQL-\u0440\u0435\u043a\u0443\u0440\u0441\u0438\u044f \u2014 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0438\u0448\u0435\u0442 \u043f\u043e-\u0441\u0432\u043e\u0435\u043c\u0443.<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u043e \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u043e\u0432 \u043f\u043e\u043a\u0430 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043a\u0440\u0443\u0442\u043e.<\/p>\n<hr\/>\n<h3>\u0412\u044b\u0432\u043e\u0434<\/h3>\n<p>Spanner Property Graph + GQL \u2014 \u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u0430\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f \u0434\u043b\u044f enterprise-\u0433\u0440\u0430\u0444\u043e\u0432 \u0441 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u0439 \u0441\u0445\u0435\u043c\u043e\u0439 \u0438 \u0431\u044e\u0434\u0436\u0435\u0442\u043e\u043c. \u041d\u043e \u0434\u043b\u044f \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0439 wiki, \u0433\u0434\u0435:<\/p>\n<ul>\n<li>\n<p>\u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0438 \u0442\u0435\u043a\u0441\u0442 \u0443\u0436\u0435 \u0436\u0438\u0432\u0443\u0442 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0411\u0414 (AlloyDB),<\/p>\n<\/li>\n<li>\n<p>\u0433\u0440\u0430\u0444 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 (&lt; 1000 \u043d\u043e\u0434),<\/p>\n<\/li>\n<li>\n<p>LLM \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u044f\u043c\u043e \u0438\u0437 SQL,<\/p>\n<\/li>\n<li>\n<p>\u0431\u044e\u0434\u0436\u0435\u0442 \u0431\u043b\u0438\u0437\u043e\u043a \u043a \u043d\u0443\u043b\u044e,<\/p>\n<\/li>\n<\/ul>\n<p>\u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0435 SQL-\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u2014 \u043f\u0440\u0430\u0433\u043c\u0430\u0442\u0438\u0447\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440. \u041c\u0435\u043d\u0435\u0435 \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0439, \u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u043d\u044b\u0439.<\/p>\n<p>\u041c\u044b \u043d\u0435 \u043e\u0442\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043e\u0442 GQL \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e, \u043d\u043e \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0443 \u0437\u0430\u0434\u0430\u0447\u0438. \u0415\u0441\u043b\u0438 wiki \u0432\u044b\u0440\u0430\u0441\u0442\u0435\u0442 \u2014 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u043d\u0430 Spanner \u0431\u0443\u0434\u0435\u0442 \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0448\u0430\u0433\u043e\u043c. \u041d\u043e \u043d\u0435 \u0440\u0430\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u0432 \u044d\u0442\u043e\u043c \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u0430\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c.<\/p>\n<hr\/>\n<p><strong>Spanner:<\/strong> <a href=\"https:\/\/github.com\/GoogleCloudPlatform\/cloud-spanner-samples\/tree\/main\/context-graph-on-spanner\" rel=\"noopener noreferrer nofollow\">cloud-spanner-samples\/context-graph-on-spanner<\/a><\/p>\n<p><strong>\u0421\u0442\u0435\u043a:<\/strong> AlloyDB Omni 16.11, pgvector, google_ml_integration 1.5.2, Vertex AI, Gemini 2.5 Flash Lite<\/p>\n<\/div>\n<p>\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\/1044164\/\">https:\/\/habr.com\/ru\/articles\/1044164\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c wiki \u043f\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430\u043c \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u2014 72 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0435\u0441\u044f \u0432 AlloyDB Omni (PostgreSQL 16.11) \u0441 pgvector \u0434\u043b\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430. \u041c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0433\u0440\u0430\u0444 \u0437\u043d\u0430\u043d\u0438\u0439: \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0440\u0451\u0431\u0440\u0430 \u043c\u0435\u0436\u0434\u0443 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u043c\u0438, 11 \u0442\u0438\u043f\u043e\u0432 \u0441\u0432\u044f\u0437\u0435\u0439, \u0432\u0435\u0441\u043e\u0432\u044b\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b. \u0413\u0440\u0430\u0444 \u043e\u0431\u043e\u0433\u0430\u0442\u0438\u043b retrieval: recall \u0432\u044b\u0440\u043e\u0441 \u0441 46.7% \u0434\u043e 68.3%.Google \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043b context-graph-on-spanner \u2014 \u0440\u0435\u0444\u0435\u0440\u0435\u043d\u0441\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u0433\u043e \u0433\u0440\u0430\u0444\u0430 \u043d\u0430 Cloud Spanner \u0441 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c Property Graph \u0438 GQL (Graph Query Language). \u0412\u043e\u0437\u043d\u0438\u043a \u0432\u043e\u043f\u0440\u043e\u0441: \u0441\u0442\u043e\u0438\u0442 \u043b\u0438 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u043d\u0430\u0448 \u0433\u0440\u0430\u0444 \u043d\u0430 Spanner \u0441 \u0435\u0433\u043e \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u0433\u0440\u0430\u0444\u043e\u0432? \u0418\u043b\u0438 \u043e\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u043d\u0430 AlloyDB?\u041c\u044b \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u043d\u0430 AlloyDB. \u0412\u043e\u0442 \u043f\u043e\u0447\u0435\u043c\u0443.\u0414\u0432\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043a \u0433\u0440\u0430\u0444\u0443Spanner: Property Graph + GQLSpanner \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 7.0+ \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 Property Graph \u2014 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u0433\u0440\u0430\u0444\u0430 \u043f\u043e\u0432\u0435\u0440\u0445 \u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0442\u0430\u0431\u043b\u0438\u0446:CREATE PROPERTY GRAPH MarketingContextGraph  NODE TABLES (Customers, Decisions, Policies, Outcomes)  EDGE TABLES (    AboutCustomer      SOURCE KEY (decision_id) REFERENCES Decisions (decision_id)      DESTINATION KEY (customer_id) REFERENCES Customers (customer_id),    FollowedPolicy      SOURCE KEY (decision_id) REFERENCES Decisions (decision_id)      DESTINATION KEY (policy_id) REFERENCES Policies (policy_id),    ResultedIn      SOURCE KEY (decision_id) REFERENCES Decisions (decision_id)      DESTINATION KEY (outcome_id) REFERENCES Outcomes (outcome_id)  );\u0417\u0430\u043f\u0440\u043e\u0441\u044b \u2014 \u043d\u0430 GQL, \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d-\u043c\u0430\u0442\u0447\u0438\u043d\u0433\u0430:GRAPH MarketingContextGraphMATCH (c:Customers {industry: $1, tier: $2})&lt;-[:AboutCustomer]-(d:Decisions {signal_type: $3})-[:ResultedIn]-&gt;(o:Outcomes)WHERE o.result = &#8216;Renewed&#8217;RETURN d.decision_type AS Action_Type, d.reasoning_text AS Success_LogicORDER BY d.timestamp DESCLIMIT 3\u041a\u0440\u0430\u0441\u0438\u0432\u043e. \u041b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u043e. \u041f\u0430\u0442\u0442\u0435\u0440\u043d-\u043c\u0430\u0442\u0447\u0438\u043d\u0433: \u00ab\u043d\u0430\u0439\u0434\u0438 \u043c\u043d\u0435 \u0432\u0441\u0435 \u043f\u0443\u0442\u0438 Decision \u2192 Customer \u2190 Decision \u2192 Outcome, \u0433\u0434\u0435 outcome = Renewed\u00bb. \u041e\u0434\u043d\u0430 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f MATCH \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 20 \u0441\u0442\u0440\u043e\u043a SQL-\u0434\u0436\u043e\u0439\u043d\u043e\u0432.AlloyDB: \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0435 CTE\u0423 \u043d\u0430\u0441 \u043d\u0435\u0442 GQL. \u041d\u043e \u0435\u0441\u0442\u044c WITH RECURSIVE \u2014 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c PostgreSQL \u0434\u043b\u044f \u043e\u0431\u0445\u043e\u0434\u0430 \u0433\u0440\u0430\u0444\u043e\u0432:CREATE OR REPLACE FUNCTION graph_neighbors(  _label TEXT, _kind TEXT DEFAULT NULL,  _depth INT DEFAULT 1, _limit INT DEFAULT 20)RETURNS TABLE (node_label TEXT, node_kind TEXT, edge_kind TEXT, depth INT, wiki_path TEXT) AS $$WITH RECURSIVE traverse(id, node_label, node_kind, wiki_path, edge_kind, depth) AS (  &#8212; Anchor: \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u044f \u043d\u043e\u0434\u0430  SELECT n.id, n.label, n.kind, n.wiki_path, NULL, 0  FROM graph_nodes n WHERE n.label = _label  UNION ALL  &#8212; Recursive step: \u043e\u0431\u0445\u043e\u0434 \u043f\u043e \u0440\u0451\u0431\u0440\u0430\u043c \u0432 \u043e\u0431\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u044b  SELECT COALESCE(t.id, s.id), COALESCE(t.label, s.label),         COALESCE(t.kind, s.kind), COALESCE(t.wiki_path, s.wiki_path),         e.kind, p.depth + 1  FROM traverse p  JOIN graph_edges e ON (e.source_id = p.id OR e.target_id = p.id)  LEFT JOIN graph_nodes t ON t.id = e.target_id AND e.source_id = p.id  LEFT JOIN graph_nodes s ON s.id = e.source_id AND e.target_id = p.id  WHERE p.depth &lt; _depth    AND (COALESCE(t.id, s.id) IS NOT NULL)    AND (_kind IS NULL OR e.kind = _kind))SELECT DISTINCT ON (node_label) node_label, node_kind, edge_kind, depth, wiki_pathFROM traverse WHERE depth &gt; 0 ORDER BY node_label, depth LIMIT _limit;$$ LANGUAGE sql STABLE;\u0413\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u043e? \u0414\u0430. \u041d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.\u041f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u043d\u0430 SQL: \u043f\u044f\u0442\u044c \u043f\u0440\u0438\u0447\u0438\u043d1. \u041e\u0434\u043d\u0430 \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043c\u0435\u0441\u0442\u043e \u0434\u0432\u0443\u0445\u0412 \u043d\u0430\u0448\u0435\u043c AlloyDB \u0443\u0436\u0435 \u0436\u0438\u0432\u0443\u0442:wiki_pages \u2014 \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446graph_nodes \u0441 pgvector \u2014 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0438 \u0434\u043b\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430graph_edges \u2014 \u0440\u0451\u0431\u0440\u0430 \u0433\u0440\u0430\u0444\u0430 \u0437\u043d\u0430\u043d\u0438\u0439ai.generate() \u2014 \u0432\u044b\u0437\u043e\u0432 Gemini \u043f\u0440\u044f\u043c\u043e \u0438\u0437 SQL\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u0433\u0440\u0430\u0444\u0430 \u043d\u0430 Spanner \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442: \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0432 AlloyDB, \u0433\u0440\u0430\u0444 \u0432 Spanner, \u0442\u0435\u043a\u0441\u0442 \u0432 AlloyDB. \u041a\u0430\u0436\u0434\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u2014 join \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u0431\u0430\u0437\u0430\u043c\u0438. \u042d\u0442\u043e \u043d\u0435 \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u0435, \u0430 \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u0438\u0435.\u041d\u0430 Spanner-\u0441\u044d\u043c\u043f\u043b\u0435 \u0433\u0440\u0430\u0444 \u0438 \u0442\u0430\u043a \u0436\u0438\u0432\u0451\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u2014 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0443 \u043d\u0438\u0445 \u043d\u0435\u0442 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0432 Spanner. \u041d\u043e \u0443 \u043d\u0430\u0441 \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0443\u0436\u0435 \u0432 AlloyDB. \u0420\u0430\u0437\u0440\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u043e\u0442 \u0433\u0440\u0430\u0444\u0430 \u2014 \u0448\u0430\u0433 \u043d\u0430\u0437\u0430\u0434.2. \u0413\u0438\u0431\u0440\u0438\u0434\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u043e\u0434\u043d\u043e\u043c SQL\u041d\u0430\u0448\u0430 \u043a\u043b\u044e\u0447\u0435\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u2014 graph_context_for_query \u2014 \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u0438 \u0433\u0440\u0430\u0444\u043e\u0432\u044b\u0439 \u043e\u0431\u0445\u043e\u0434 \u0432 \u043e\u0434\u043d\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435:WITH seeds AS (  &#8212; \u0412\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u2192 5 seed-\u043d\u043e\u0434  SELECT n.id, n.wiki_path, 1 &#8212; (n.embedding &lt;=&gt; _embedding) AS sim  FROM graph_nodes n ORDER BY n.embedding &lt;=&gt; _embedding LIMIT $2),hops AS (  &#8212; Seed \u2192 hop 1 (\u043f\u0440\u044f\u043c\u044b\u0435 \u0441\u043e\u0441\u0435\u0434\u0438)  SELECT nb.id, nb.wiki_path, &#8230; FROM seeds s  JOIN graph_edges e ON e.source_id = s.id  JOIN graph_nodes nb ON nb.id = e.target_id  UNION ALL  &#8212; Seed \u2192 hop 2 (\u0441\u043e\u0441\u0435\u0434\u0438 \u0441\u043e\u0441\u0435\u0434\u0435\u0439)  SELECT nb2.id, nb2.wiki_path, &#8230; FROM seeds s  JOIN graph_edges e ON e.source_id = s.id  JOIN graph_edges e2 ON e2.source_id = e.target_id  JOIN graph_nodes nb2 ON nb2.id = e2.target_id)SELECT &#8230; FROM hops JOIN wiki_pages wp ON wp.path = h.wiki_path;\u0412\u0435\u043a\u0442\u043e\u0440 \u043d\u0430\u0448\u0451\u043b seed-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. \u0413\u0440\u0430\u0444 \u0440\u0430\u0441\u043a\u0440\u044b\u043b \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043d\u0430 2 \u043f\u0440\u044b\u0436\u043a\u0430. Edge weights \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u044e\u0442 \u0432 \u0440\u0430\u043d\u0436\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2014 \u043e\u0434\u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441 rank_score = similarity \u00d7 edge_weight \/ (depth + 1).\u041d\u0430 Spanner \u044d\u0442\u043e \u0434\u0432\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u0430: \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u0432 \u043e\u0434\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0435, GQL-\u0437\u0430\u043f\u0440\u043e\u0441 \u2014 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c. \u0421\u043a\u043b\u0435\u0438\u0432\u0430\u0442\u044c \u2014 \u0432 \u043a\u043e\u0434\u0435 \u0430\u0433\u0435\u043d\u0442\u0430.3. ai.generate() \u0438\u0437 SQL \u2014 Killer FeatureAlloyDB \u0441 google_ml_integration \u2265 1.5.2 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c Gemini \u043f\u0440\u044f\u043c\u043e \u0438\u0437 plpgsql:_result := ai.generate(_prompt);\u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u044d\u0442\u043e \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0440\u0451\u0431\u0435\u0440: 205 \u043d\u0435\u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 mentions-\u0440\u0451\u0431\u0435\u0440 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0442\u0438\u043f\u044b (depends_on, develops, based_on) \u0437\u0430 $0.01 \u043d\u0430 \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0433\u043e\u043d. \u0411\u0435\u0437 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u044f, \u0431\u0435\u0437 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430-\u0438\u043c\u043f\u043e\u0440\u0442\u0430.Spanner \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e ai.generate(). \u041a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0440\u0451\u0431\u0435\u0440 \u2014 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442.4. \u0422\u0430\u0431\u043b\u0438\u0446\u0430 edge types \u2014 \u0433\u0438\u0431\u0447\u0435, \u0447\u0435\u043c Property Graph DDLSpanner \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0440\u0435\u0431\u0440\u0430:CREATE TABLE AboutCustomer (decision_id &#8230;, customer_id &#8230;) PRIMARY KEY (decision_id, customer_id);CREATE TABLE FollowedPolicy (decision_id &#8230;, policy_id &#8230;) PRIMARY KEY (decision_id, policy_id);CREATE TABLE ResultedIn (decision_id &#8230;, outcome_id &#8230;) PRIMARY KEY (decision_id, outcome_id);\u0422\u0440\u0438 \u0442\u0438\u043f\u0430 \u0440\u0451\u0431\u0435\u0440 \u2014 \u0442\u0440\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b. \u0423 \u043d\u0430\u0441 11 \u0442\u0438\u043f\u043e\u0432 \u2014 \u044d\u0442\u043e 11 \u0442\u0430\u0431\u043b\u0438\u0446? \u0418\u043b\u0438 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u0430\u044f graph_edges \u0441 kind?\u0423 \u043d\u0430\u0441 \u2014 \u043e\u0434\u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 graph_edges \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u043c \u043f\u043e\u043b\u0435\u043c kind. \u0425\u043e\u0447\u0435\u0448\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0442\u0438\u043f \u0440\u0435\u0431\u0440\u0430 \u2014 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c DDL, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e INSERT \u0441 \u043d\u043e\u0432\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c kind. \u042d\u0442\u043e \u0432\u0430\u0436\u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0441\u0442\u0443\u0449\u0435\u0439 wiki, \u0433\u0434\u0435 \u0442\u0438\u043f\u044b \u0441\u0432\u044f\u0437\u0435\u0439 \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u044e\u0442.Spanner-\u043f\u043e\u0434\u0445\u043e\u0434 \u0441\u0442\u0440\u043e\u0436\u0435, \u043d\u043e \u0436\u0451\u0441\u0442\u0447\u0435. \u0414\u043b\u044f enterprise-\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0441\u0445\u0435\u043c\u043e\u0439 \u2014 \u043e\u0442\u043b\u0438\u0447\u043d\u043e. \u0414\u043b\u044f \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 wiki, \u0433\u0434\u0435 \u043c\u044b \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u044b\u0435 \u0442\u0438\u043f\u044b \u2014 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043d\u0435\u0433\u0438\u0431\u043a\u043e.5. \u0421\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b\u0410\u0441\u043f\u0435\u043a\u0442Spanner + GQLAlloyDB + SQL\u0411\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445Spanner ($$$, \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441)AlloyDB Omni (\u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043d\u0430\u0448\u0435\u043c VPS)\u0412\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a\u041d\u0443\u0436\u0435\u043d \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 (Vertex AI Matching Engine)pgvector \u0432 \u0442\u043e\u0439 \u0436\u0435 \u0411\u0414LLM \u0438\u0437 \u0411\u0414\u041d\u0435\u0442ai.generate()\u0413\u0440\u0430\u0444\u043e\u0432\u044b\u0439 \u044f\u0437\u044b\u043aGQL (\u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439)WITH RECURSIVE (\u0438\u043c\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439)\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0432\u0435\u043a\u0442\u043e\u0440 + \u0433\u0440\u0430\u0444\u0412 \u043a\u043e\u0434\u0435 \u0430\u0433\u0435\u043d\u0442\u0430\u0412 \u043e\u0434\u043d\u043e\u043c SQL-\u0437\u0430\u043f\u0440\u043e\u0441\u0435\u041d\u043e\u0432\u044b\u0435 \u0442\u0438\u043f\u044b \u0440\u0451\u0431\u0435\u0440\u041d\u043e\u0432\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 + DDLINSERT \u0441 \u043d\u043e\u0432\u044b\u043c kind\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c~$100\/\u043c\u0435\u0441 (Spanner instance)$0 (\u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442)\u0414\u043b\u044f \u0441\u0442\u0430\u0440\u0442\u0430\u043f\u0430\/\u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u00ab100\/\u043c\u0435\u0441 \u0437\u0430 \u043d\u043e\u0432\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441\u00bb \u2014 \u044d\u0442\u043e \u043d\u0435 \u0432\u043e\u043f\u0440\u043e\u0441 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u0439, \u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u0432\u044b\u0436\u0438\u0432\u0430\u043d\u0438\u044f.\u0427\u0435\u0433\u043e \u043d\u0430\u043c \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0431\u0435\u0437 GQL\u0427\u0435\u0441\u0442\u043d\u043e \u2014 \u0435\u0441\u0442\u044c \u0432\u0435\u0449\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 GQL \u0434\u0435\u043b\u0430\u0435\u0442 \u043b\u0443\u0447\u0448\u0435:\u041f\u0430\u0442\u0442\u0435\u0440\u043d-\u043c\u0430\u0442\u0447\u0438\u043d\u0433. \u0417\u0430\u043f\u0440\u043e\u0441 \u00ab\u043d\u0430\u0439\u0434\u0438 \u0432\u0441\u0435 \u043f\u0443\u0442\u0438 A \u2192 B \u2192 C, \u0433\u0434\u0435 B \u2014 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0442\u0438\u043f\u00bb \u043d\u0430 GQL \u2014 \u043e\u0434\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0430 MATCH. \u041d\u0430 SQL \u2014 \u0434\u0432\u0430 JOIN + WITH RECURSIVE + \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u0443\u0442\u044c. \u041a\u043e\u0434 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u0438\u043d\u043d\u0435\u0435 \u0438 \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f.\u0414\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043e\u0431\u0445\u043e\u0434. GQL \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0431\u0445\u043e\u0434\u0438\u0442 \u0433\u0440\u0430\u0444 \u0432 \u043e\u0431\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u044b: ()-[]-() \u0431\u0435\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0412 \u043d\u0430\u0448\u0435\u043c SQL \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c e.source_id = p.id OR e.target_id = p.id \u0441 COALESCE \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u043a\u0430\u043a\u0430\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u0430 \u2014 \u0441\u043e\u0441\u0435\u0434.\u0427\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c. GQL-\u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442 \u043b\u044e\u0431\u043e\u0439, \u043a\u0442\u043e \u0437\u043d\u0430\u043a\u043e\u043c \u0441 Cypher (Neo4j). SQL-\u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043d\u0430 30 \u0441\u0442\u0440\u043e\u043a \u0441 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0435\u0439 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c.\u041d\u043e \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e use case \u2014 \u0433\u0440\u0430\u0444 \u0441 72 \u043d\u043e\u0434\u0430\u043c\u0438 \u0438 215 \u0440\u0451\u0431\u0440\u0430\u043c\u0438, \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0439 2-3 \u0430\u0433\u0435\u043d\u0442\u0430 \u2014 \u044d\u0442\u043e \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u0430\u044f \u043c\u043e\u0449\u044c. SQL \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f.\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430\u0448 retrieval pipeline\u0414\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0442\u044b \u043a\u0430\u0440\u0442\u0438\u043d\u044b \u2014 \u0432\u0435\u0441\u044c \u043f\u0443\u0442\u044c \u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0434\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430:\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442: \u00ab\u041a\u0430\u043a \u0441\u0432\u044f\u0437\u0430\u043d\u044b MesaNet \u0438 Titans?\u00bb        \u2502        \u25bc1. getEmbedding(query) \u2192 Vertex AI \u2192 768-\u043c\u0435\u0440\u043d\u044b\u0439 \u0432\u0435\u043a\u0442\u043e\u0440        \u2502        \u25bc2. graph_context_for_query(embedding, top_k=5, hop_depth=1)   \u2502   \u251c\u2500 \u0412\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a: 5 seed-\u0441\u0442\u0440\u0430\u043d\u0438\u0446 (MesaNet, Titans, NLM, &#8230;)   \u2502   \u251c\u2500 Hop 1: \u0441\u043e\u0441\u0435\u0434\u0438 seed-\u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u043f\u043e \u0433\u0440\u0430\u0444\u0443   \u2502  \u2192 graph_edges JOIN graph_nodes   \u2502  \u2192 edge_weight: depends_on=0.95, mentions=0.3   \u2502   \u251c\u2500 rank_score = similarity \u00d7 edge_weight \/ (depth + 1)   \u2502   \u2514\u2500 JOIN wiki_pages \u2192 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446        \u2502        \u25bc3. MCP-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 wiki_graph_context \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442:[seed] MesaNet (sim=0.82)[seed] Titans (sim=0.78)[hop1] Surrogate Memory (via based_on, rank=0.62)[hop1] Memory as Context (via develops, rank=0.55)[hop2] Fast Weight Programmers (via depends_on, rank=0.31)        \u2502        \u25bc4. LLM-\u0430\u0433\u0435\u043d\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442   \u0438 \u0441\u0442\u0440\u043e\u0438\u0442 \u043e\u0442\u0432\u0435\u0442 \u0441\u043e \u0441\u0441\u044b\u043b\u043a\u0430\u043c\u0438 \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0442\u044b\u0413\u0434\u0435 GQL \u0431\u044b\u043b \u0431\u044b \u043a\u0441\u0442\u0430\u0442\u0438\u0415\u0441\u043b\u0438 \u0431\u044b wiki \u0432\u044b\u0440\u043e\u0441\u043b\u0430 \u0434\u043e \u0441\u043e\u0442\u0435\u043d \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0438 \u0434\u0435\u0441\u044f\u0442\u043a\u043e\u0432 \u0430\u0433\u0435\u043d\u0442\u043e\u0432 \u2014 Spanner + GQL \u0441\u0442\u0430\u043b \u0431\u044b \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d:\u0411\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b: \u00ab\u043d\u0430\u0439\u0434\u0438 \u0432\u0441\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 X, \u043d\u043e \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0430\u0442 Y, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c Y \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 Z\u00bb \u2014 \u043d\u0430 GQL \u044d\u0442\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 MATCH, \u043d\u0430 SQL \u2014 \u043a\u0430\u0441\u043a\u0430\u0434 CTE.\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c: Spanner \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u0433\u0440\u0430\u0444\u043e\u0432\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0433\u0440\u0430\u0444\u0430\u0445. CTE \u043d\u0430 10 000+ \u043d\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0447\u0430\u0442\u044c \u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442\u044c.\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0430\u0446\u0438\u044f: GQL \u2014 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 ISO (GQL\/ISO 39075). SQL-\u0440\u0435\u043a\u0443\u0440\u0441\u0438\u044f \u2014 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0438\u0448\u0435\u0442 \u043f\u043e-\u0441\u0432\u043e\u0435\u043c\u0443.\u041d\u043e \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u043e\u0432 \u043f\u043e\u043a\u0430 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043a\u0440\u0443\u0442\u043e.\u0412\u044b\u0432\u043e\u0434Spanner Property Graph + GQL \u2014 \u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u0430\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f \u0434\u043b\u044f enterprise-\u0433\u0440\u0430\u0444\u043e\u0432 \u0441 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u0439 \u0441\u0445\u0435\u043c\u043e\u0439 \u0438 \u0431\u044e\u0434\u0436\u0435\u0442\u043e\u043c. \u041d\u043e \u0434\u043b\u044f \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0439 wiki, \u0433\u0434\u0435:\u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0438 \u0442\u0435\u043a\u0441\u0442 \u0443\u0436\u0435 \u0436\u0438\u0432\u0443\u0442 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0411\u0414 (AlloyDB),\u0433\u0440\u0430\u0444 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 (&lt; 1000 \u043d\u043e\u0434),LLM \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u044f\u043c\u043e \u0438\u0437 SQL,\u0431\u044e\u0434\u0436\u0435\u0442 \u0431\u043b\u0438\u0437\u043e\u043a \u043a \u043d\u0443\u043b\u044e,\u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0435 SQL-\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u2014 \u043f\u0440\u0430\u0433\u043c\u0430\u0442\u0438\u0447\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440. \u041c\u0435\u043d\u0435\u0435 \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0439, \u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u043d\u044b\u0439.\u041c\u044b \u043d\u0435 \u043e\u0442\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043e\u0442 GQL \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e, \u043d\u043e \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0443 \u0437\u0430\u0434\u0430\u0447\u0438. \u0415\u0441\u043b\u0438 wiki \u0432\u044b\u0440\u0430\u0441\u0442\u0435\u0442 \u2014 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u043d\u0430 Spanner \u0431\u0443\u0434\u0435\u0442 \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0448\u0430\u0433\u043e\u043c. \u041d\u043e \u043d\u0435 \u0440\u0430\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u0432 \u044d\u0442\u043e\u043c \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u0430\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c.Spanner: cloud-spanner-samples\/context-graph-on-spanner\u0421\u0442\u0435\u043a: AlloyDB Omni 16.11, pgvector, google_ml_integration 1.5.2, Vertex AI, Gemini 2.5 Flash Lite\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 https:\/\/habr.com\/ru\/articles\/1044164\/<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-482557","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/482557","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=482557"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/482557\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=482557"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=482557"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=482557"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}