{"datalog_plan": {"patterns": [{"idx": 0, "table": "mentat.datoms_text_new", "attribute": "::user/email", "variables": {"value": "?email", "entity": "?e"}}, {"idx": 1, "table": "mentat.datoms_text_new", "attribute": "::user/name", "variables": {"value": "?name", "entity": "?e"}}], "complexity": {"cte": false, "joins": 2, "union_all": false, "aggregates": false}, "predicates": [], "not_clauses": 0, "or_branches": 0, "join_variables": ["?e"], "ground_bindings": {}, "where_functions": []}, "explain_plan": "Unique (cost=10231.47..10231.48 rows=1 width=56)\n Output: ((current_text.e)::text), current_text_1.v\n InitPlan 1 (returns $0)\n -> Seq Scan on mentat.schema (cost=0.00..1.49 rows=1 width=8)\n Output: schema.entid\n Filter: (schema.ident = ':user/email'::text)\n InitPlan 2 (returns $1)\n -> Seq Scan on mentat.schema schema_1 (cost=0.00..1.49 rows=1 width=8)\n Output: schema_1.entid\n Filter: (schema_1.ident = ':user/name'::text)\n -> Sort (cost=10228.50..10228.50 rows=1 width=56)\n Output: ((current_text.e)::text), current_text_1.v\n Sort Key: ((current_text.e)::text), current_text_1.v\n -> Gather (cost=1000.86..10228.49 rows=1 width=56)\n Output: ((current_text.e)::text), current_text_1.v\n Workers Planned: 4\n Params Evaluated: $0, $1\n -> Nested Loop (cost=0.85..9228.39 rows=1 width=56)\n Output: (current_text.e)::text, current_text_1.v\n -> Parallel Index Only Scan using idx_current_text_aev on mentat.current_text (cost=0.43..9226.82 rows=1 width=8)\n Output: current_text.store_id, current_text.a, current_text.e, current_text.v, current_text.tx\n Index Cond: ((current_text.store_id = '0'::bigint) AND (current_text.a = $0))\n Filter: (current_text.v = 'user0@example.com'::text)\n -> Index Only Scan using idx_current_text_aev on mentat.current_text current_text_1 (cost=0.43..1.55 rows=1 width=32)\n Output: current_text_1.store_id, current_text_1.a, current_text_1.e, current_text_1.v, current_text_1.tx\n Index Cond: ((current_text_1.store_id = '0'::bigint) AND (current_text_1.a = $1) AND (current_text_1.e = current_text.e))\nQuery Identifier: -2555953961116655244", "datalog_query": "[:find ?e ?name :in $ ?email :where [?e :user/email ?email] [?e :user/name ?name]]", "generated_sql": "SELECT DISTINCT datoms0.e::TEXT, CASE datoms1.value_type_tag WHEN 0 THEN datoms1.v_ref::TEXT WHEN 1 THEN datoms1.v_bool::TEXT WHEN 2 THEN datoms1.v_long::TEXT WHEN 3 THEN 'd:' || ('x' || encode(float8send(datoms1.v_double), 'hex'))::bit(64)::bigint::TEXT WHEN 4 THEN to_char(datoms1.v_instant AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') WHEN 7 THEN datoms1.v_text WHEN 8 THEN ':' || datoms1.v_keyword WHEN 10 THEN datoms1.v_uuid::TEXT WHEN 11 THEN encode(datoms1.v_bytes, 'hex') ELSE NULL::TEXT END FROM (SELECT e, a, 7::SMALLINT AS value_type_tag, NULL::BIGINT AS v_ref, NULL::BOOLEAN AS v_bool, NULL::BIGINT AS v_long, NULL::DOUBLE PRECISION AS v_double, v AS v_text, NULL::TEXT AS v_keyword, NULL::TIMESTAMPTZ AS v_instant, NULL::UUID AS v_uuid, NULL::BYTEA AS v_bytes, tx, true AS added FROM mentat.current_text WHERE store_id = $1) AS datoms0, (SELECT e, a, 7::SMALLINT AS value_type_tag, NULL::BIGINT AS v_ref, NULL::BOOLEAN AS v_bool, NULL::BIGINT AS v_long, NULL::DOUBLE PRECISION AS v_double, v AS v_text, NULL::TEXT AS v_keyword, NULL::TIMESTAMPTZ AS v_instant, NULL::UUID AS v_uuid, NULL::BYTEA AS v_bytes, tx, true AS added FROM mentat.current_text WHERE store_id = $1) AS datoms1 WHERE datoms0.a = (SELECT entid FROM mentat.schema WHERE ident = $2) AND datoms0.added = true AND datoms1.e = datoms0.e AND datoms1.a = (SELECT entid FROM mentat.schema WHERE ident = $3) AND datoms1.added = true AND (datoms0.v_text = $4 AND datoms0.value_type_tag = 7)"}