1. (2.66ms; exec 2.63 + fetch 0.03; 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.56ms; exec 9.14 + fetch 0.43; rows 69) 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. (41.49ms; exec 41.03 + fetch 0.45; rows 69) 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.15ms; exec 2.06 + fetch 0.09; rows 8) 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. (0.87ms; exec 0.86 + 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.68ms; exec 0.65 + 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.9ms; exec 1.81 + fetch 0.09; rows 8) SELECT s.stage_path, s.stage_name, s.source_date, s.evidence_id, f.requested_url AS source_url FROM sejm_process_stages …
8. (3.25ms; exec 3.21 + fetch 0.04; 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. (2.31ms; exec 2.3 + fetch 0.02; 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. (2.03ms; exec 2 + fetch 0.03; 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. (15.09ms; exec 11.66 + fetch 3.44; 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.65ms; exec 1.62 + fetch 0.03; rows 1) SELECT JSON_VALUE(r.snapshot, '$.dateOfReceipt') AS received_on, JSON_VALUE(r.snapshot, '$.applicantType') AS applicant_…
13. (0.88ms; exec 0.85 + 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. (3.47ms; exec 3.43 + fetch 0.05; 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.81ms; exec 0.8 + 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 = 4485
16. (0.71ms; exec 0.7 + 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.54ms; exec 0.53 + 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. (2.02ms; exec 1.84 + fetch 0.18; rows 69) 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.47ms; exec 1.46 + 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.61ms; exec 1.59 + fetch 0.02; rows 1) SELECT stage_path, evidence_id FROM sejm_process_stages JOIN evidence stage_evidence ON stage_evidence.id = evidence_id …
21. (0.65ms; exec 0.65 + fetch 0; rows 0) SELECT object_id, current_revision_id FROM sejm_prints WHERE term = 10 AND print_number = '1257'
22. (0.64ms; exec 0.62 + fetch 0.02; rows 1) SELECT term, bill_number FROM sejm_bills WHERE object_id = 548
23. (1.75ms; exec 1.73 + 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…
24. (0.93ms; exec 0.92 + 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…
25. (1.35ms; exec 1.34 + 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…
26. (0.65ms; exec 0.64 + 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…
27. (3.37ms; exec 3.33 + fetch 0.04; 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…
28. (0.67ms; exec 0.66 + 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 …
29. (0.85ms; exec 0.84 + 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 …
30. (2.44ms; exec 2.42 + fetch 0.01; rows 0) WITH RECURSIVE related_prints (print_id, revision_id, print_number, relation_evidence_id) AS ( SELECT p.object_id, CASE …
31. (5.35ms; exec 5.3 + fetch 0.05; rows 0) WITH RECURSIVE root_prints (print_id) AS ( SELECT DISTINCT p.object_id FROM sejm_bills b JOIN object_revisions bill_revi…
32. (4.62ms; exec 4.56 + fetch 0.06; 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…
33. (5.18ms; exec 5.03 + fetch 0.14; rows 77) SELECT re.revision_id, re.evidence_id FROM revision_evidence re JOIN evidence e ON e.id = re.evidence_id JOIN fetches f …
34. (4.45ms; exec 4.43 + fetch 0.02; rows 0) SELECT assignment.id AS assignment_id, assignment.object_id, topic.id AS topic_id, topic.slug, topic.name, assignment.ma…
toggle
1. (2.66ms; exec 2.63 + fetch 0.03; 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 = 548 AND (NULL IS NULL OR r.id IS NOT NULL)
2. (9.56ms; exec 9.14 + fetch 0.43; rows 69) 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 = 548
3. (41.49ms; exec 41.03 + fetch 0.45; rows 69) 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 (128381,175805,178330,207076,209614,242199,244737,277310,279848,316415,318953,323187,325725,353780,356318,390109,392647,429280,431818,469909,472447,498537,501075,505061,507599,512158,514696,517803,520341,523390,525928,530495,533033,536134,538672,543106,545644,548764,551302,556039,558577,561669,564207,567284,569822,573544,576082,579172,581710,586454,588992,591958,594496,597651,600189,603822,606360,609229,611767,615268,617806,620732,623270,627011,629549,632668,635210,640152,642692)
4. (2.15ms; exec 2.06 + fetch 0.09; rows 8) 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 = 4485 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 = 4485)) ORDER BY s.parent_path IS NOT NULL, s.ordinal
5. (0.87ms; exec 0.86 + 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 = 41 AND d.current_revision_id IS NOT NULL ORDER BY d.source_date
6. (0.68ms; exec 0.65 + 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 = 4485
7. (1.9ms; exec 1.81 + fetch 0.09; rows 8) 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 = 4025
8. (3.25ms; exec 3.21 + fetch 0.04; 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 = 41 AND v.voting_number = 23
9. (2.31ms; exec 2.3 + fetch 0.02; 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 = 4031 AND (NULL IS NULL OR f.finished_at <= NULL) ORDER BY re.evidence_id LIMIT 1
10. (2.03ms; exec 2 + fetch 0.03; 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 = 4031 AND (NULL IS NULL OR f.finished_at <= NULL)
11. (15.09ms; exec 11.66 + fetch 3.44; 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 = 4031 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.65ms; exec 1.62 + fetch 0.03; 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 = 548 AND (NULL IS NULL OR r.recorded_at <= NULL) ORDER BY r.revision_no DESC LIMIT 1
13. (0.88ms; exec 0.85 + 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 = 548
14. (3.47ms; exec 3.43 + fetch 0.05; 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 = 548 AND l.bill_revision_id = 548 AND (NULL IS NULL OR f.finished_at <= NULL)
15. (0.81ms; exec 0.8 + 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 = 4485
16. (0.71ms; exec 0.7 + 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.54ms; exec 0.53 + 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 = 548
18. (2.02ms; exec 1.84 + fetch 0.18; rows 69) 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 = 548 AND l.bill_revision_id = 548
19. (1.47ms; exec 1.46 + 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 = 4025 AND re.field_path = '$' AND f.requested_url = 'https://api.sejm.gov.pl/sejm/term10/processes/1217' 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.61ms; exec 1.59 + fetch 0.02; rows 1) 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 = 128372 AND process_evidence.fetch_id = stage_evidence.fetch_id WHERE process_revision_id = 4025 AND stage_type = 'CommitteeReport' ORDER BY stage_path
21. (0.65ms; exec 0.65 + fetch 0; rows 0) SELECT object_id, current_revision_id FROM sejm_prints WHERE term = 10 AND print_number = '1257'
22. (0.64ms; exec 0.62 + fetch 0.02; rows 1) SELECT term, bill_number FROM sejm_bills WHERE object_id = 548
23. (1.75ms; exec 1.73 + 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
24. (0.93ms; exec 0.92 + 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 = 548
25. (1.35ms; exec 1.34 + 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 = '1217' ORDER BY p.object_id
26. (0.65ms; exec 0.64 + 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 = 548
27. (3.37ms; exec 3.33 + fetch 0.04; 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 = '1217' 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 = 548 AND link.bill_revision_id = 548 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
28. (0.67ms; exec 0.66 + 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 = 4485
29. (0.85ms; exec 0.84 + 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:%'
30. (2.44ms; exec 2.42 + 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 = '1217' 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
31. (5.35ms; exec 5.3 + fetch 0.05; 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 = 548 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')
32. (4.62ms; exec 4.56 + fetch 0.06; 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 (548,4485) 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
33. (5.18ms; exec 5.03 + fetch 0.14; rows 77) 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 (548,4025) GROUP BY re.revision_id, re.evidence_id ORDER BY re.revision_id, re.evidence_id
34. (4.45ms; exec 4.43 + fetch 0.02; 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 (548) ORDER BY assignment.object_id, topic.name, FIELD(assignment.match_basis, 'eli_keyword', 'fulltext_phrase', 'title_term'), assignment.id
Top slow:
41.49ms SELECT e.id, e.fetch_id, e.selector_type, e.selector, e.quote_text, f.requested_url, f.finished_at, …
15.09ms SELECT v.mp_number, v.mp_entity_id, v.raw_choice, v.raw_club, v.first_name, v.last_name, v.evidence_…
9.56ms SELECT DISTINCT p.object_id, p.term, p.print_number, p.title, p.eli_id, a.object_id AS legal_act_id,…
toggle
41.49ms 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 (128381,175805,178330,207076,209614,242199,244737,277310,279848,316415,318953,323187,325725,353780,356318,390109,392647,429280,431818,469909,472447,498537,501075,505061,507599,512158,514696,517803,520341,523390,525928,530495,533033,536134,538672,543106,545644,548764,551302,556039,558577,561669,564207,567284,569822,573544,576082,579172,581710,586454,588992,591958,594496,597651,600189,603822,606360,609229,611767,615268,617806,620732,623270,627011,629549,632668,635210,640152,642692)
15.09ms 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 = 4031 AND (NULL IS NULL OR f.finished_at <= NULL) ORDER BY v.raw_club, v.last_name, v.first_name, v.mp_number
9.56ms 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 = 548
N+1 candidates:
2× (1.35ms) SELECT r.id, r.snapshot FROM sejm_processes p JOIN object_revisions r ON r.id = p.current_…
toggle
2× (1.35ms) SELECT r.id, r.snapshot FROM sejm_processes p JOIN object_revisions r ON r.id = p.current_revision_id WHERE p.object_id = ?