Files
WorthPath/docs/transfers-plan.json
T

17 lines
3.6 KiB
JSON

{
"sql": "\n SELECT t.id FROM Transfer t FORCE INDEX (Transfer_userId_effectiveDate_id_idx)\n STRAIGHT_JOIN Position s ON s.id = t.sourceId\n STRAIGHT_JOIN Position d ON d.id = t.targetId\n WHERE t.userId = ? AND s.userId = ? AND d.userId = ?\n AND s.hidden = false AND d.hidden = false\n \n \n \n \n ORDER BY t.effectiveDate DESC, t.id DESC LIMIT ?",
"plan": [
{
"f0": "-> Limit: 51 row(s) (cost=30.6 rows=0.6) (actual time=0.022..0.122 rows=51 loops=1)\n -> Nested loop inner join (cost=30.6 rows=0.6) (actual time=0.0216..0.12 rows=51 loops=1)\n -> Nested loop inner join (cost=28.5 rows=6) (actual time=0.0197..0.0934 rows=51 loops=1)\n -> Index lookup on t using Transfer_userId_effectiveDate_id_idx (userId='75778c01-f278-42e1-bc07-85331d1be657') (reverse) (cost=7.5 rows=60) (actual time=0.0155..0.0644 rows=51 loops=1)\n -> Filter: ((s.hidden = false) and (s.userId = '75778c01-f278-42e1-bc07-85331d1be657')) (cost=0.25 rows=0.1) (actual time=391e-6..452e-6 rows=1 loops=51)\n -> Single-row index lookup on s using PRIMARY (id=t.sourceId) (cost=0.25 rows=1) (actual time=124e-6..144e-6 rows=1 loops=51)\n -> Filter: ((d.hidden = false) and (d.userId = '75778c01-f278-42e1-bc07-85331d1be657')) (cost=0.252 rows=0.1) (actual time=345e-6..406e-6 rows=1 loops=51)\n -> Single-row index lookup on d using PRIMARY (id=t.targetId) (cost=0.252 rows=1) (actual time=93.5e-6..113e-6 rows=1 loops=51)\n"
}
],
"cursorSql": "\n SELECT t.id FROM Transfer t FORCE INDEX (Transfer_userId_effectiveDate_id_idx)\n STRAIGHT_JOIN Position s ON s.id = t.sourceId\n STRAIGHT_JOIN Position d ON d.id = t.targetId\n WHERE t.userId = ? AND s.userId = ? AND d.userId = ?\n AND s.hidden = false AND d.hidden = false\n \n \n \n AND (t.effectiveDate < ? OR\n (t.effectiveDate = ? AND t.id < ?))\n ORDER BY t.effectiveDate DESC, t.id DESC LIMIT ?",
"cursorPlan": [
{
"f0": "-> Limit: 51 row(s) (cost=9.7 rows=0.11) (actual time=0.0221..0.046 rows=10 loops=1)\n -> Nested loop inner join (cost=9.7 rows=0.11) (actual time=0.0218..0.0453 rows=10 loops=1)\n -> Nested loop inner join (cost=9.31 rows=1.1) (actual time=0.0199..0.0387 rows=10 loops=1)\n -> Index range scan on t using Transfer_userId_effectiveDate_id_idx over (userId = '75778c01-f278-42e1-bc07-85331d1be657' AND effectiveDate < '2026-10-01 04:00:00.000') OR (userId = '75778c01-f278-42e1-bc07-85331d1be657' AND effectiveDate = '2026-10-01 04:00:00.000' AND id < '475b7d99-f250-44cb-a7ea-d75c9c3d39fa') (reverse), with index condition: ((t.userId = '75778c01-f278-42e1-bc07-85331d1be657') and ((t.effectiveDate < TIMESTAMP'2026-10-01 04:00:00') or ((t.effectiveDate = TIMESTAMP'2026-10-01 04:00:00') and (t.id < '475b7d99-f250-44cb-a7ea-d75c9c3d39fa')))) (cost=5.46 rows=11) (actual time=0.0157..0.0295 rows=10 loops=1)\n -> Filter: ((s.hidden = false) and (s.userId = '75778c01-f278-42e1-bc07-85331d1be657')) (cost=0.251 rows=0.1) (actual time=664e-6..728e-6 rows=1 loops=10)\n -> Single-row index lookup on s using PRIMARY (id=t.sourceId) (cost=0.251 rows=1) (actual time=366e-6..386e-6 rows=1 loops=10)\n -> Filter: ((d.hidden = false) and (d.userId = '75778c01-f278-42e1-bc07-85331d1be657')) (cost=0.259 rows=0.1) (actual time=470e-6..534e-6 rows=1 loops=10)\n -> Single-row index lookup on d using PRIMARY (id=t.targetId) (cost=0.259 rows=1) (actual time=208e-6..230e-6 rows=1 loops=10)\n"
}
],
"candidateRows": 51,
"nextPageRows": 10
}