1. (1.53ms; exec 1.51 + fetch 0.02; 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.91ms; exec 9.45 + fetch 0.46; 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. (12.87ms; exec 12.16 + fetch 0.71; 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.84ms; exec 2.67 + fetch 0.17; rows 13) 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.37ms; exec 1.35 + 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. (1.24ms; exec 1.22 + fetch 0.02; 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.44ms; exec 1.37 + fetch 0.07; rows 13) 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.84ms; exec 2.8 + 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.34ms; exec 2.31 + fetch 0.03; 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. (0.99ms; exec 0.96 + 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. (10.78ms; exec 9.53 + fetch 1.25; 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.01ms; exec 0.99 + fetch 0.02; rows 1) SELECT JSON_VALUE(r.snapshot, '$.dateOfReceipt') AS received_on, JSON_VALUE(r.snapshot, '$.applicantType') AS applicant_…
13. (0.71ms; exec 0.7 + 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.06ms; exec 3.05 + 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.66ms; exec 0.65 + 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 = 4384
16. (0.66ms; exec 0.65 + 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.41ms; exec 0.4 + 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. (1.78ms; exec 1.56 + fetch 0.22; 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. (0.98ms; exec 0.98 + 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.05ms; exec 1.04 + fetch 0.01; rows 1) SELECT stage_path, evidence_id FROM sejm_process_stages JOIN evidence stage_evidence ON stage_evidence.id = evidence_id …
21. (0.46ms; exec 0.45 + fetch 0; rows 0) SELECT object_id, current_revision_id FROM sejm_prints WHERE term = 10 AND print_number = '1467'
22. (0.43ms; exec 0.42 + fetch 0.01; rows 1) SELECT term, bill_number FROM sejm_bills WHERE object_id = 606
23. (1.29ms; exec 1.29 + 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.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…
25. (1.1ms; exec 1.09 + 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.5ms; exec 0.49 + 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. (2.87ms; exec 2.86 + fetch 0.01; 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.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 …
29. (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 …
30. (2.18ms; exec 2.16 + 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.43ms; exec 5.42 + fetch 0.01; rows 0) WITH RECURSIVE root_prints (print_id) AS ( SELECT DISTINCT p.object_id FROM sejm_bills b JOIN object_revisions bill_revi…
32. (2.75ms; exec 2.71 + fetch 0.04; 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. (3.94ms; exec 3.87 + fetch 0.08; 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 …
34. (2.26ms; exec 2.24 + 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. (1.53ms; exec 1.51 + fetch 0.02; 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 = 606 AND (NULL IS NULL OR r.id IS NOT NULL)
2. (9.91ms; exec 9.45 + fetch 0.46; 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 = 606
3. (12.87ms; exec 12.16 + fetch 0.71; 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 (120345,175921,178446,207192,209730,242315,244853,277426,279964,316531,319069,323303,325841,353896,356434,390225,392763,429396,431934,470025,472563,498653,501191,505177,507715,512274,514812,517919,520457,523506,526044,530611,533149,536250,538788,543222,545760,548880,551418,556155,558693,561785,564323,567400,569938,573660,576198,579288,581826,586570,589108,592074,594612,597767,600305,603938,606476,609345,611883,615384,617922,620848,623386,627127,629665,632784,635326)
4. (2.84ms; exec 2.67 + fetch 0.17; rows 13) 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 = 4384 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 = 4384)) ORDER BY s.parent_path IS NOT NULL, s.ordinal
5. (1.37ms; exec 1.35 + 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. (1.24ms; exec 1.22 + fetch 0.02; 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 = 4384
7. (1.44ms; exec 1.37 + fetch 0.07; rows 13) 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 = 3924
8. (2.84ms; exec 2.8 + 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 = 38 AND v.voting_number = 43
9. (2.34ms; exec 2.31 + fetch 0.03; 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 = 6217 AND (NULL IS NULL OR f.finished_at <= NULL) ORDER BY re.evidence_id LIMIT 1
10. (0.99ms; exec 0.96 + 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 = 6217 AND (NULL IS NULL OR f.finished_at <= NULL)
11. (10.78ms; exec 9.53 + fetch 1.25; 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 = 6217 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.01ms; exec 0.99 + 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 = 606 AND (NULL IS NULL OR r.recorded_at <= NULL) ORDER BY r.revision_no DESC LIMIT 1
13. (0.71ms; exec 0.7 + 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 = 606
14. (3.06ms; exec 3.05 + 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 = 606 AND l.bill_revision_id = 606 AND (NULL IS NULL OR f.finished_at <= NULL)
15. (0.66ms; exec 0.65 + 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 = 4384
16. (0.66ms; exec 0.65 + 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.41ms; exec 0.4 + 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 = 606
18. (1.78ms; exec 1.56 + fetch 0.22; 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 = 606 AND l.bill_revision_id = 606
19. (0.98ms; exec 0.98 + 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 = 3924 AND re.field_path = '$' AND f.requested_url = 'https://api.sejm.gov.pl/sejm/term10/processes/1342' 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.05ms; exec 1.04 + fetch 0.01; 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 = 120331 AND process_evidence.fetch_id = stage_evidence.fetch_id WHERE process_revision_id = 3924 AND stage_type = 'CommitteeReport' ORDER BY stage_path
21. (0.46ms; exec 0.45 + fetch 0; rows 0) SELECT object_id, current_revision_id FROM sejm_prints WHERE term = 10 AND print_number = '1467'
22. (0.43ms; exec 0.42 + fetch 0.01; rows 1) SELECT term, bill_number FROM sejm_bills WHERE object_id = 606
23. (1.29ms; exec 1.29 + 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.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 = 606
25. (1.1ms; exec 1.09 + 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 = '1342' ORDER BY p.object_id
26. (0.5ms; exec 0.49 + 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 = 606
27. (2.87ms; exec 2.86 + fetch 0.01; 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 = '1342' 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 = 606 AND link.bill_revision_id = 606 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.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 = 4384
29. (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:%'
30. (2.18ms; exec 2.16 + 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 = '1342' 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.43ms; exec 5.42 + fetch 0.01; 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 = 606 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. (2.75ms; exec 2.71 + fetch 0.04; 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 (606,4384) 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. (3.94ms; exec 3.87 + fetch 0.08; 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 (606,3924) GROUP BY re.revision_id, re.evidence_id ORDER BY re.revision_id, re.evidence_id
34. (2.26ms; exec 2.24 + 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 (606) ORDER BY assignment.object_id, topic.name, FIELD(assignment.match_basis, 'eli_keyword', 'fulltext_phrase', 'title_term'), assignment.id
Top slow:
12.87ms SELECT e.id, e.fetch_id, e.selector_type, e.selector, e.quote_text, f.requested_url, f.finished_at, …
10.78ms SELECT v.mp_number, v.mp_entity_id, v.raw_choice, v.raw_club, v.first_name, v.last_name, v.evidence_…
9.91ms SELECT DISTINCT p.object_id, p.term, p.print_number, p.title, p.eli_id, a.object_id AS legal_act_id,…
toggle
12.87ms 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 (120345,175921,178446,207192,209730,242315,244853,277426,279964,316531,319069,323303,325841,353896,356434,390225,392763,429396,431934,470025,472563,498653,501191,505177,507715,512274,514812,517919,520457,523506,526044,530611,533149,536250,538788,543222,545760,548880,551418,556155,558693,561785,564323,567400,569938,573660,576198,579288,581826,586570,589108,592074,594612,597767,600305,603938,606476,609345,611883,615384,617922,620848,623386,627127,629665,632784,635326)
10.78ms 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 = 6217 AND (NULL IS NULL OR f.finished_at <= NULL) ORDER BY v.raw_club, v.last_name, v.first_name, v.mp_number
9.91ms 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 = 606
N+1 candidates:
2× (1.81ms) SELECT r.id, r.snapshot FROM sejm_processes p JOIN object_revisions r ON r.id = p.current_…
toggle
2× (1.81ms) SELECT r.id, r.snapshot FROM sejm_processes p JOIN object_revisions r ON r.id = p.current_revision_id WHERE p.object_id = ?