1. (1.38ms; exec 1.34 + fetch 0.04; rows 1) SELECT b.object_id, b.term, b.bill_number, b.print_number, b.title, b.source_status, COALESCE(r.snapshot, JSON_OBJECT())…
2. (9.06ms; exec 8.22 + fetch 0.84; rows 67) SELECT DISTINCT p.object_id, p.term, p.print_number, p.title, p.eli_id, a.object_id AS legal_act_id, l.evidence_id, pr.s…
3. (8.36ms; exec 7.88 + fetch 0.48; rows 67) SELECT e.id, e.fetch_id, e.selector_type, e.selector, e.quote_text, f.requested_url, f.finished_at, s.code AS source_cod…
4. (2.53ms; exec 2.29 + fetch 0.24; rows 16) SELECT s.stage_path, s.parent_path, s.stage_type, s.stage_name, s.source_date, s.evidence_id, p.term, r.snapshot AS proc…
5. (1.33ms; exec 1.31 + fetch 0.02; rows 0) SELECT d.object_id, d.source_date, d.statement_count, (SELECT MIN(re.evidence_id) FROM revision_evidence re WHERE re.rev…
6. (0.99ms; exec 0.96 + fetch 0.03; rows 1) SELECT r.id, r.snapshot FROM sejm_processes p JOIN object_revisions r ON r.id = p.current_revision_id WHERE p.object_id …
7. (1.34ms; exec 1.26 + fetch 0.08; rows 16) SELECT s.stage_path, s.stage_name, s.source_date, s.evidence_id, f.requested_url AS source_url FROM sejm_process_stages …
8. (2.5ms; exec 2.45 + fetch 0.05; rows 1) SELECT v.object_id, v.current_revision_id AS revision_id, v.reconciliation_state, r.snapshot FROM sejm_votes v JOIN obje…
9. (4.55ms; exec 4.52 + fetch 0.04; rows 1) SELECT re.evidence_id, f.requested_url FROM revision_evidence re JOIN evidence e ON e.id = re.evidence_id JOIN fetches f…
10. (1.21ms; exec 1.16 + fetch 0.05; rows 6) SELECT t.source_field, t.announced_count, t.individual_count, t.evidence_id FROM sejm_vote_totals t JOIN evidence e ON e…
11. (9.83ms; exec 8.12 + fetch 1.71; rows 460) SELECT v.mp_number, v.mp_entity_id, v.raw_choice, v.raw_club, v.first_name, v.last_name, v.evidence_id FROM sejm_individ…
12. (1.17ms; exec 1.15 + fetch 0.02; rows 1) SELECT JSON_VALUE(r.snapshot, '$.dateOfReceipt') AS received_on, JSON_VALUE(r.snapshot, '$.applicantType') AS applicant_…
13. (0.63ms; exec 0.62 + fetch 0.02; rows 1) SELECT b.term, r.id, r.snapshot FROM sejm_bills b JOIN object_revisions r ON r.id = b.current_revision_id WHERE b.object…
14. (1.83ms; exec 1.82 + fetch 0.01; rows 1) SELECT DISTINCT l.process_id FROM sejm_bill_process_links l JOIN sejm_processes p ON p.object_id = l.process_id AND p.te…
15. (0.58ms; exec 0.57 + fetch 0.01; rows 1) SELECT r.snapshot FROM sejm_processes p JOIN object_revisions r ON r.id = p.current_revision_id WHERE p.object_id = 4435
16. (0.65ms; exec 0.64 + fetch 0.01; rows 0) SELECT s.committee_code, s.sitting_number, r.id AS revision_id, r.snapshot FROM sejm_committee_sittings s JOIN object_re…
17. (0.52ms; exec 0.51 + fetch 0.01; rows 1) SELECT b.term, r.id AS revision_id FROM sejm_bills b JOIN object_revisions r ON r.id = b.current_revision_id WHERE b.obj…
18. (3.01ms; exec 2.17 + fetch 0.84; rows 67) SELECT p.object_id AS process_id, p.term, p.print_number, r.id AS revision_id, r.snapshot FROM sejm_bill_process_links l…
19. (1.25ms; exec 1.24 + fetch 0.01; rows 1) SELECT re.evidence_id FROM revision_evidence re JOIN evidence e ON e.id = re.evidence_id JOIN fetches f ON f.id = e.fetc…
20. (1.57ms; exec 1.55 + fetch 0.02; rows 2) SELECT stage_path, evidence_id FROM sejm_process_stages JOIN evidence stage_evidence ON stage_evidence.id = evidence_id …
21. (0.48ms; exec 0.47 + fetch 0.01; rows 0) SELECT object_id, current_revision_id FROM sejm_prints WHERE term = 10 AND print_number = '1357'
22. (0.41ms; exec 0.4 + fetch 0; rows 0) SELECT object_id, current_revision_id FROM sejm_prints WHERE term = 10 AND print_number = '1357-A'
23. (0.42ms; exec 0.41 + fetch 0.01; rows 1) SELECT term, bill_number FROM sejm_bills WHERE object_id = 583
24. (1.27ms; exec 1.25 + fetch 0.01; rows 0) SELECT r.external_key AS cms_id, o.id AS observation_id, o.fetch_id, o.payload, f.requested_url AS senate_url, LOWER(HEX…
25. (0.55ms; exec 0.54 + fetch 0.01; rows 1) SELECT b.term, r.id AS revision_id, JSON_VALUE(r.snapshot, '$.print') AS print_number FROM sejm_bills b JOIN object_revi…
26. (0.94ms; exec 0.93 + fetch 0.01; rows 0) SELECT p.source_id, p.article_id, p.action_kind, p.review_mode, o.id AS observation_id, o.payload, projected.evidence_id…
27. (0.51ms; exec 0.5 + fetch 0.01; rows 1) SELECT b.term, r.id AS revision_id, r.snapshot FROM sejm_bills b JOIN object_revisions r ON r.id = b.current_revision_id…
28. (2.74ms; exec 2.71 + fetch 0.02; rows 1) SELECT p.object_id AS process_id, p.term, p.print_number, MIN(link.evidence_id) AS evidence_id FROM sejm_bill_process_li…
29. (0.57ms; exec 0.56 + fetch 0.01; rows 1) SELECT r.id, r.snapshot FROM sejm_processes p JOIN object_revisions r ON r.id = p.current_revision_id WHERE p.object_id …
30. (0.65ms; exec 0.64 + fetch 0.01; rows 0) SELECT DISTINCT CAST(r.scope AS CHAR) AS scope FROM source_records r JOIN sources source ON source.id = r.source_id AND …
31. (1.7ms; exec 1.69 + fetch 0.01; rows 0) WITH RECURSIVE related_prints (print_id, revision_id, print_number, relation_evidence_id) AS ( SELECT p.object_id, CASE …
32. (6.97ms; exec 6.95 + fetch 0.03; rows 0) WITH RECURSIVE root_prints (print_id) AS ( SELECT DISTINCT p.object_id FROM sejm_bills b JOIN object_revisions bill_revi…
33. (3.42ms; exec 3.34 + fetch 0.08; rows 2) SELECT r.id AS revision_id, r.object_id, r.revision_no, r.snapshot, MIN(o.observed_at) AS observed_at, CASE WHEN b.objec…
34. (4.6ms; exec 4.47 + fetch 0.13; rows 75) SELECT re.revision_id, re.evidence_id FROM revision_evidence re JOIN evidence e ON e.id = re.evidence_id JOIN fetches f …
35. (3.21ms; exec 3.18 + fetch 0.03; rows 0) SELECT assignment.id AS assignment_id, assignment.object_id, topic.id AS topic_id, topic.slug, topic.name, assignment.ma…
toggle
1. (1.38ms; exec 1.34 + fetch 0.04; rows 1) SELECT b.object_id, b.term, b.bill_number, b.print_number, b.title, b.source_status, COALESCE(r.snapshot, JSON_OBJECT()) AS snapshot FROM sejm_bills b LEFT JOIN object_revisions r ON r.id = ( SELECT r2.id FROM object_revisions r2 WHERE r2.object_id = b.object_id AND (NULL IS NULL OR r2.recorded_at <= NULL) ORDER BY r2.revision_no DESC LIMIT 1 ) WHERE b.object_id = 583 AND (NULL IS NULL OR r.id IS NOT NULL)
2. (9.06ms; exec 8.22 + fetch 0.84; rows 67) SELECT DISTINCT p.object_id, p.term, p.print_number, p.title, p.eli_id, a.object_id AS legal_act_id, l.evidence_id, pr.snapshot, (SELECT MIN(re.evidence_id) FROM revision_evidence re WHERE re.revision_id = pr.id AND re.field_path = '$') AS process_evidence_id, publication.published_date AS publication_date, (SELECT MIN(e.id) FROM eli_act_source_facts fact JOIN eli_act_fact_evidence fe ON fe.fact_id = fact.id JOIN evidence e ON e.id = fe.evidence_id WHERE fact.act_id = a.object_id AND fact.field_code = 'promulgation' AND fact.source_date = publication.published_date AND JSON_VALUE(e.selector, '$.pointer') = '/promulgation') AS publication_evidence_id FROM sejm_bill_process_links l JOIN sejm_bills b ON b.object_id = l.bill_id AND b.current_revision_id = l.bill_revision_id JOIN sejm_processes p ON p.object_id = l.process_id JOIN object_revisions pr ON pr.id = p.current_revision_id LEFT JOIN legal_acts a ON a.object_id = p.legal_act_id AND a.eli_id = p.eli_id LEFT JOIN publications publication ON publication.act_id = a.object_id AND a.publisher_code = 'DU' AND publication.publisher_code = 'DU' WHERE l.bill_id = 583
3. (8.36ms; exec 7.88 + fetch 0.48; rows 67) SELECT e.id, e.fetch_id, e.selector_type, e.selector, e.quote_text, f.requested_url, f.finished_at, s.code AS source_code, LOWER(HEX(a.sha256)) AS artifact_sha256, a.detected_mime, a.byte_size FROM evidence e JOIN fetches f ON f.id = e.fetch_id JOIN source_endpoints ep ON ep.id = f.endpoint_id JOIN sources s ON s.id = ep.source_id JOIN artifacts a ON a.id = e.artifact_id WHERE e.id IN (123609,175875,178400,207146,209684,242269,244807,277380,279918,316485,319023,323257,325795,353850,356388,390179,392717,429350,431888,469979,472517,498607,501145,505131,507669,512228,514766,517873,520411,523460,525998,530565,533103,536204,538742,543176,545714,548834,551372,556109,558647,561739,564277,567354,569892,573614,576152,579242,581780,586524,589062,592028,594566,597721,600259,603892,606430,609299,611837,615338,617876,620802,623340,627081,629619,632738,635280)
4. (2.53ms; exec 2.29 + fetch 0.24; rows 16) SELECT s.stage_path, s.parent_path, s.stage_type, s.stage_name, s.source_date, s.evidence_id, p.term, r.snapshot AS process_snapshot FROM sejm_process_stages s JOIN sejm_processes p ON p.object_id = s.process_id JOIN object_revisions r ON r.id = s.process_revision_id WHERE s.process_revision_id = COALESCE( (SELECT r.id FROM object_revisions r WHERE r.object_id = 4435 AND NULL IS NOT NULL AND r.recorded_at <= NULL ORDER BY r.revision_no DESC LIMIT 1), (SELECT IF(NULL IS NULL, p.current_revision_id, NULL) FROM sejm_processes p WHERE p.object_id = 4435)) ORDER BY s.parent_path IS NOT NULL, s.ordinal
5. (1.33ms; exec 1.31 + fetch 0.02; rows 0) SELECT d.object_id, d.source_date, d.statement_count, (SELECT MIN(re.evidence_id) FROM revision_evidence re WHERE re.revision_id = d.current_revision_id AND re.field_path = '$') AS evidence_id FROM sejm_transcript_days d WHERE d.term = 10 AND d.proceeding_number = 38 AND d.current_revision_id IS NOT NULL ORDER BY d.source_date
6. (0.99ms; exec 0.96 + fetch 0.03; rows 1) SELECT r.id, r.snapshot FROM sejm_processes p JOIN object_revisions r ON r.id = p.current_revision_id WHERE p.object_id = 4435
7. (1.34ms; exec 1.26 + fetch 0.08; rows 16) SELECT s.stage_path, s.stage_name, s.source_date, s.evidence_id, f.requested_url AS source_url FROM sejm_process_stages s JOIN evidence e ON e.id = s.evidence_id JOIN fetches f ON f.id = e.fetch_id WHERE s.process_revision_id = 3975
8. (2.5ms; exec 2.45 + fetch 0.05; rows 1) SELECT v.object_id, v.current_revision_id AS revision_id, v.reconciliation_state, r.snapshot FROM sejm_votes v JOIN object_revisions r ON r.id = v.current_revision_id WHERE v.term = 10 AND v.sitting_number = 38 AND v.voting_number = 19
9. (4.55ms; exec 4.52 + fetch 0.04; rows 1) SELECT re.evidence_id, f.requested_url FROM revision_evidence re JOIN evidence e ON e.id = re.evidence_id JOIN fetches f ON f.id = e.fetch_id WHERE re.revision_id = 6190 AND (NULL IS NULL OR f.finished_at <= NULL) ORDER BY re.evidence_id LIMIT 1
10. (1.21ms; exec 1.16 + fetch 0.05; rows 6) SELECT t.source_field, t.announced_count, t.individual_count, t.evidence_id FROM sejm_vote_totals t JOIN evidence e ON e.id = t.evidence_id JOIN fetches f ON f.id = e.fetch_id WHERE t.vote_revision_id = 6190 AND (NULL IS NULL OR f.finished_at <= NULL)
11. (9.83ms; exec 8.12 + fetch 1.71; rows 460) SELECT v.mp_number, v.mp_entity_id, v.raw_choice, v.raw_club, v.first_name, v.last_name, v.evidence_id FROM sejm_individual_votes v JOIN evidence e ON e.id = v.evidence_id JOIN fetches f ON f.id = e.fetch_id WHERE v.vote_revision_id = 6190 AND (NULL IS NULL OR f.finished_at <= NULL) ORDER BY v.raw_club, v.last_name, v.first_name, v.mp_number
12. (1.17ms; exec 1.15 + fetch 0.02; rows 1) SELECT JSON_VALUE(r.snapshot, '$.dateOfReceipt') AS received_on, JSON_VALUE(r.snapshot, '$.applicantType') AS applicant_type, JSON_VALUE(r.snapshot, '$.submissionType') AS submission_type, JSON_VALUE(r.snapshot, '$.description') AS description, JSON_VALUE(r.snapshot, '$.print') AS print_number FROM object_revisions r WHERE r.object_id = 583 AND (NULL IS NULL OR r.recorded_at <= NULL) ORDER BY r.revision_no DESC LIMIT 1
13. (0.63ms; exec 0.62 + fetch 0.02; rows 1) SELECT b.term, r.id, r.snapshot FROM sejm_bills b JOIN object_revisions r ON r.id = b.current_revision_id WHERE b.object_id = 583
14. (1.83ms; exec 1.82 + fetch 0.01; rows 1) SELECT DISTINCT l.process_id FROM sejm_bill_process_links l JOIN sejm_processes p ON p.object_id = l.process_id AND p.term = 10 JOIN evidence e ON e.id = l.evidence_id JOIN fetches f ON f.id = e.fetch_id WHERE l.bill_id = 583 AND l.bill_revision_id = 583 AND (NULL IS NULL OR f.finished_at <= NULL)
15. (0.58ms; exec 0.57 + fetch 0.01; rows 1) SELECT r.snapshot FROM sejm_processes p JOIN object_revisions r ON r.id = p.current_revision_id WHERE p.object_id = 4435
16. (0.65ms; exec 0.64 + fetch 0.01; rows 0) SELECT s.committee_code, s.sitting_number, r.id AS revision_id, r.snapshot FROM sejm_committee_sittings s JOIN object_revisions r ON r.id = s.current_revision_id WHERE s.term = 10
17. (0.52ms; exec 0.51 + fetch 0.01; rows 1) SELECT b.term, r.id AS revision_id FROM sejm_bills b JOIN object_revisions r ON r.id = b.current_revision_id WHERE b.object_id = 583
18. (3.01ms; exec 2.17 + fetch 0.84; rows 67) SELECT p.object_id AS process_id, p.term, p.print_number, r.id AS revision_id, r.snapshot FROM sejm_bill_process_links l JOIN sejm_processes p ON p.object_id = l.process_id AND p.term = 10 JOIN object_revisions r ON r.id = p.current_revision_id WHERE l.bill_id = 583 AND l.bill_revision_id = 583
19. (1.25ms; exec 1.24 + fetch 0.01; rows 1) SELECT re.evidence_id FROM revision_evidence re JOIN evidence e ON e.id = re.evidence_id JOIN fetches f ON f.id = e.fetch_id JOIN source_endpoints endpoint ON endpoint.id = f.endpoint_id JOIN sources source ON source.id = endpoint.source_id AND source.code = 'sejm-processes' WHERE re.revision_id = 3975 AND re.field_path = '$' AND f.requested_url = 'https://api.sejm.gov.pl/sejm/term10/processes/1305' AND f.http_status = 200 AND f.outcome = 'success' AND (NULL IS NULL OR f.finished_at <= NULL) ORDER BY f.finished_at DESC, re.evidence_id DESC LIMIT 1
20. (1.57ms; exec 1.55 + fetch 0.02; rows 2) SELECT stage_path, evidence_id FROM sejm_process_stages JOIN evidence stage_evidence ON stage_evidence.id = evidence_id JOIN evidence process_evidence ON process_evidence.id = 123592 AND process_evidence.fetch_id = stage_evidence.fetch_id WHERE process_revision_id = 3975 AND stage_type = 'CommitteeReport' ORDER BY stage_path
21. (0.48ms; exec 0.47 + fetch 0.01; rows 0) SELECT object_id, current_revision_id FROM sejm_prints WHERE term = 10 AND print_number = '1357'
22. (0.41ms; exec 0.4 + fetch 0; rows 0) SELECT object_id, current_revision_id FROM sejm_prints WHERE term = 10 AND print_number = '1357-A'
23. (0.42ms; exec 0.41 + fetch 0.01; rows 1) SELECT term, bill_number FROM sejm_bills WHERE object_id = 583
24. (1.27ms; exec 1.25 + fetch 0.01; rows 0) SELECT r.external_key AS cms_id, o.id AS observation_id, o.fetch_id, o.payload, f.requested_url AS senate_url, LOWER(HEX(a.sha256)) AS artifact_sha256 FROM source_records r JOIN sources s ON s.id = r.source_id JOIN source_record_observations o ON o.record_id = r.id JOIN fetches f ON f.id = o.fetch_id JOIN processing_inputs input ON input.run_id = o.processing_run_id AND input.role = 'source_response' AND input.ordinal = 1 JOIN artifacts a ON a.id = input.artifact_id WHERE s.code = 'senat-legislative-initiatives' AND r.record_type = 'senat-initiative' AND o.id = ( SELECT latest.id FROM source_record_observations latest JOIN fetches latest_fetch ON latest_fetch.id = latest.fetch_id WHERE latest.record_id = r.id AND latest.locator = CONCAT('detail:', CAST(r.external_key AS CHAR)) AND (NULL IS NULL OR latest_fetch.finished_at <= NULL) ORDER BY latest_fetch.finished_at DESC, latest.fetch_id DESC, latest.id DESC LIMIT 1 ) ORDER BY r.id
25. (0.55ms; exec 0.54 + fetch 0.01; rows 1) SELECT b.term, r.id AS revision_id, JSON_VALUE(r.snapshot, '$.print') AS print_number FROM sejm_bills b JOIN object_revisions r ON r.id = b.current_revision_id WHERE b.object_id = 583
26. (0.94ms; exec 0.93 + fetch 0.01; rows 0) SELECT p.source_id, p.article_id, p.action_kind, p.review_mode, o.id AS observation_id, o.payload, projected.evidence_id FROM president_events p JOIN sources s ON s.id = p.source_id AND s.code = 'president-legislation' JOIN president_event_observations projected ON projected.observation_id = ( SELECT latest.id FROM president_event_observations next_projection JOIN source_record_observations latest ON latest.id = next_projection.observation_id JOIN fetches f ON f.id = latest.fetch_id WHERE next_projection.event_id = p.object_id AND (NULL IS NULL OR (latest.observed_at <= NULL AND f.finished_at <= NULL)) ORDER BY f.finished_at DESC, latest.id DESC LIMIT 1) JOIN source_record_observations o ON o.id = projected.observation_id WHERE p.print_number = '1305' ORDER BY p.object_id
27. (0.51ms; exec 0.5 + fetch 0.01; rows 1) SELECT b.term, r.id AS revision_id, r.snapshot FROM sejm_bills b JOIN object_revisions r ON r.id = b.current_revision_id WHERE b.object_id = 583
28. (2.74ms; exec 2.71 + fetch 0.02; rows 1) SELECT p.object_id AS process_id, p.term, p.print_number, MIN(link.evidence_id) AS evidence_id FROM sejm_bill_process_links link JOIN sejm_processes p ON p.object_id = link.process_id AND p.term = 10 AND p.print_number = '1305' JOIN evidence e ON e.id = link.evidence_id AND e.selector_type = 'json_pointer' JOIN fetches f ON f.id = e.fetch_id AND f.http_status = 200 AND f.outcome = 'success' JOIN source_endpoints endpoint ON endpoint.id = f.endpoint_id JOIN sources source ON source.id = endpoint.source_id WHERE link.bill_id = 583 AND link.bill_revision_id = 583 AND ((source.code = 'sejm-bills' AND JSON_VALUE(e.selector, '$.pointer') LIKE '%/print') OR (source.code = 'sejm-processes' AND JSON_VALUE(e.selector, '$.pointer') = '/number')) AND (NULL IS NULL OR f.finished_at <= NULL) GROUP BY p.object_id, p.term, p.print_number ORDER BY p.object_id
29. (0.57ms; exec 0.56 + fetch 0.01; rows 1) SELECT r.id, r.snapshot FROM sejm_processes p JOIN object_revisions r ON r.id = p.current_revision_id WHERE p.object_id = 4435
30. (0.65ms; exec 0.64 + fetch 0.01; rows 0) SELECT DISTINCT CAST(r.scope AS CHAR) AS scope FROM source_records r JOIN sources source ON source.id = r.source_id AND source.code = 'tk-ipo-otk' WHERE r.record_type = 'tk-ipo-petition-target' AND r.scope LIKE 'case:%'
31. (1.7ms; exec 1.69 + fetch 0.01; rows 0) WITH RECURSIVE related_prints (print_id, revision_id, print_number, relation_evidence_id) AS ( SELECT p.object_id, CASE WHEN NULL IS NULL THEN p.current_revision_id ELSE (SELECT o.revision_id FROM sejm_observations o JOIN fetches f ON f.id = o.fetch_id JOIN object_revisions r ON r.id = o.revision_id WHERE o.object_id = p.object_id AND o.observed_at <= NULL AND f.finished_at <= NULL AND r.recorded_at <= NULL ORDER BY (o.source_pointer = '') DESC, f.finished_at DESC, o.fetch_id DESC, r.revision_no DESC LIMIT 1) END, p.print_number, CAST(NULL AS UNSIGNED) FROM sejm_prints p WHERE p.term = 10 AND p.print_number = '1305' UNION DISTINCT SELECT child.object_id, observation.revision_id, child.print_number, a.evidence_id FROM related_prints parent JOIN sejm_additional_prints a ON a.parent_print_id = parent.print_id AND a.parent_revision_id = parent.revision_id JOIN sejm_prints child ON child.object_id = a.child_print_id JOIN evidence relation ON relation.id = a.evidence_id JOIN sejm_observations observation ON observation.object_id = child.object_id AND observation.fetch_id = relation.fetch_id AND observation.artifact_id = relation.artifact_id AND observation.source_pointer = JSON_VALUE(relation.selector, '$.pointer') ) SELECT d.object_id AS id, d.title, p.print_number, MIN(p.relation_evidence_id) AS relation_evidence_id FROM related_prints p JOIN documents d ON d.owner_object_id = p.print_id WHERE p.revision_id IS NOT NULL AND EXISTS (SELECT 1 FROM document_versions v WHERE v.document_id = d.object_id AND (NULL IS NULL OR v.first_observed_at <= NULL)) GROUP BY d.object_id, d.title, p.print_number ORDER BY d.object_id
32. (6.97ms; exec 6.95 + fetch 0.03; rows 0) WITH RECURSIVE root_prints (print_id) AS ( SELECT DISTINCT p.object_id FROM sejm_bills b JOIN object_revisions bill_revision ON bill_revision.object_id = b.object_id JOIN sejm_prints p ON p.term = b.term AND p.print_number = JSON_VALUE(bill_revision.snapshot, '$.print') WHERE b.object_id = 583 AND EXISTS (SELECT 1 FROM sejm_observations bill_observation WHERE bill_observation.object_id = b.object_id AND bill_observation.revision_id = bill_revision.id) ), related_prints (print_id) AS ( SELECT print_id FROM root_prints UNION DISTINCT SELECT additional.child_print_id FROM related_prints parent JOIN sejm_additional_prints additional ON additional.parent_print_id = parent.print_id JOIN object_revisions print_revision ON print_revision.id = additional.parent_revision_id JOIN evidence relation_evidence ON relation_evidence.id = additional.evidence_id JOIN fetches relation_fetch ON relation_fetch.id = relation_evidence.fetch_id WHERE 1 = 1 ) SELECT DISTINCT p.object_id AS process_id, d.object_id AS document_id FROM related_prints related JOIN sejm_prints print ON print.object_id = related.print_id LEFT JOIN sejm_processes p ON p.term = print.term AND p.print_number = print.print_number LEFT JOIN documents d ON d.owner_object_id = related.print_id AND EXISTS (SELECT 1 FROM document_versions version WHERE version.document_id = d.object_id AND version.version_basis = 'source_key')
33. (3.42ms; exec 3.34 + fetch 0.08; rows 2) SELECT r.id AS revision_id, r.object_id, r.revision_no, r.snapshot, MIN(o.observed_at) AS observed_at, CASE WHEN b.object_id IS NOT NULL THEN 'bill' ELSE 'process' END AS entity_type, b.bill_number, p.print_number FROM object_revisions r JOIN sejm_observations o ON o.revision_id = r.id AND o.object_id = r.object_id JOIN fetches f ON f.id = o.fetch_id LEFT JOIN sejm_bills b ON b.object_id = r.object_id LEFT JOIN sejm_processes p ON p.object_id = r.object_id WHERE r.object_id IN (583,4435) GROUP BY r.id, r.object_id, r.revision_no, r.snapshot, b.object_id, b.bill_number, p.print_number ORDER BY r.object_id, observed_at, r.revision_no
34. (4.6ms; exec 4.47 + fetch 0.13; rows 75) SELECT re.revision_id, re.evidence_id FROM revision_evidence re JOIN evidence e ON e.id = re.evidence_id JOIN fetches f ON f.id = e.fetch_id WHERE re.revision_id IN (583,3975) GROUP BY re.revision_id, re.evidence_id ORDER BY re.revision_id, re.evidence_id
35. (3.21ms; exec 3.18 + fetch 0.03; rows 0) SELECT assignment.id AS assignment_id, assignment.object_id, topic.id AS topic_id, topic.slug, topic.name, assignment.match_basis, assignment.matched_value, assignment.evidence_id, rule.rule_code, rule.version AS rule_version, evidence.quote_text, CASE WHEN bill.object_id IS NULL THEN 'act' ELSE 'case' END AS kind, COALESCE(bill.title, act.title) AS title, COALESCE(bill.bill_number, act.eli_id) AS identifier, CASE WHEN bill.object_id IS NULL THEN CONCAT('/acts/', assignment.object_id) ELSE CONCAT('/cases/', assignment.object_id) END AS url, latest.decision AS latest_decision, actor.display_name AS latest_decision_by, latest.recorded_at AS latest_decision_at, NULL AS my_decision, NULL AS my_decision_at FROM topic_assignments assignment JOIN objects source_object ON source_object.id = assignment.object_id AND source_object.current_revision_id = assignment.revision_id JOIN topics topic ON topic.id = assignment.topic_id JOIN topic_rules rule ON rule.id = assignment.rule_id JOIN evidence ON evidence.id = assignment.evidence_id LEFT JOIN sejm_bills bill ON bill.object_id = assignment.object_id LEFT JOIN legal_acts act ON act.object_id = assignment.object_id LEFT JOIN topic_decisions latest ON latest.id = ( SELECT decision.id FROM topic_decisions decision WHERE decision.assignment_id = assignment.id ORDER BY decision.recorded_at DESC, decision.id DESC LIMIT 1) LEFT JOIN users actor ON actor.id = latest.actor_user_id WHERE assignment.is_current = 1 AND rule.enabled = 1 AND topic.enabled = 1 AND assignment.object_id IN (583) ORDER BY assignment.object_id, topic.name, FIELD(assignment.match_basis, 'eli_keyword', 'fulltext_phrase', 'title_term'), assignment.id
Top slow:
9.83ms SELECT v.mp_number, v.mp_entity_id, v.raw_choice, v.raw_club, v.first_name, v.last_name, v.evidence_…
9.06ms SELECT DISTINCT p.object_id, p.term, p.print_number, p.title, p.eli_id, a.object_id AS legal_act_id,…
8.36ms SELECT e.id, e.fetch_id, e.selector_type, e.selector, e.quote_text, f.requested_url, f.finished_at, …
toggle
9.83ms SELECT v.mp_number, v.mp_entity_id, v.raw_choice, v.raw_club, v.first_name, v.last_name, v.evidence_id FROM sejm_individual_votes v JOIN evidence e ON e.id = v.evidence_id JOIN fetches f ON f.id = e.fetch_id WHERE v.vote_revision_id = 6190 AND (NULL IS NULL OR f.finished_at <= NULL) ORDER BY v.raw_club, v.last_name, v.first_name, v.mp_number
9.06ms SELECT DISTINCT p.object_id, p.term, p.print_number, p.title, p.eli_id, a.object_id AS legal_act_id, l.evidence_id, pr.snapshot, (SELECT MIN(re.evidence_id) FROM revision_evidence re WHERE re.revision_id = pr.id AND re.field_path = '$') AS process_evidence_id, publication.published_date AS publication_date, (SELECT MIN(e.id) FROM eli_act_source_facts fact JOIN eli_act_fact_evidence fe ON fe.fact_id = fact.id JOIN evidence e ON e.id = fe.evidence_id WHERE fact.act_id = a.object_id AND fact.field_code = 'promulgation' AND fact.source_date = publication.published_date AND JSON_VALUE(e.selector, '$.pointer') = '/promulgation') AS publication_evidence_id FROM sejm_bill_process_links l JOIN sejm_bills b ON b.object_id = l.bill_id AND b.current_revision_id = l.bill_revision_id JOIN sejm_processes p ON p.object_id = l.process_id JOIN object_revisions pr ON pr.id = p.current_revision_id LEFT JOIN legal_acts a ON a.object_id = p.legal_act_id AND a.eli_id = p.eli_id LEFT JOIN publications publication ON publication.act_id = a.object_id AND a.publisher_code = 'DU' AND publication.publisher_code = 'DU' WHERE l.bill_id = 583
8.36ms SELECT e.id, e.fetch_id, e.selector_type, e.selector, e.quote_text, f.requested_url, f.finished_at, s.code AS source_code, LOWER(HEX(a.sha256)) AS artifact_sha256, a.detected_mime, a.byte_size FROM evidence e JOIN fetches f ON f.id = e.fetch_id JOIN source_endpoints ep ON ep.id = f.endpoint_id JOIN sources s ON s.id = ep.source_id JOIN artifacts a ON a.id = e.artifact_id WHERE e.id IN (123609,175875,178400,207146,209684,242269,244807,277380,279918,316485,319023,323257,325795,353850,356388,390179,392717,429350,431888,469979,472517,498607,501145,505131,507669,512228,514766,517873,520411,523460,525998,530565,533103,536204,538742,543176,545714,548834,551372,556109,558647,561739,564277,567354,569892,573614,576152,579242,581780,586524,589062,592028,594566,597721,600259,603892,606430,609299,611837,615338,617876,620802,623340,627081,629619,632738,635280)
N+1 candidates:
2× (1.56ms) SELECT r.id, r.snapshot FROM sejm_processes p JOIN object_revisions r ON r.id = p.current_…
2× (0.89ms) SELECT object_id, current_revision_id FROM sejm_prints WHERE term = ? AND print_number = ?
toggle
2× (1.56ms) SELECT r.id, r.snapshot FROM sejm_processes p JOIN object_revisions r ON r.id = p.current_revision_id WHERE p.object_id = ?
2× (0.89ms) SELECT object_id, current_revision_id FROM sejm_prints WHERE term = ? AND print_number = ?