1. (1.38ms; exec 1.37 + 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. (7.92ms; exec 7.53 + fetch 0.39; 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. (3.87ms; exec 3.4 + 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. (1.6ms; exec 1.52 + fetch 0.08; rows 14) 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.74ms; exec 0.73 + fetch 0.01; 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.49ms; exec 0.48 + 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 …
7. (0.82ms; exec 0.75 + fetch 0.07; rows 14) SELECT s.stage_path, s.stage_name, s.source_date, s.evidence_id, f.requested_url AS source_url FROM sejm_process_stages …
8. (1.67ms; exec 1.65 + fetch 0.03; 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. (0.89ms; exec 0.88 + fetch 0.01; 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.71ms; exec 0.69 + fetch 0.02; 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. (8.05ms; exec 7.18 + fetch 0.87; 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.26ms; exec 1.25 + 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.61 + fetch 0.01; 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.9ms; exec 1.88 + fetch 0.03; 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.68ms; exec 0.66 + 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 = 4446
16. (1.05ms; exec 1.04 + 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.96ms; exec 0.94 + fetch 0.02; 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.64ms; exec 2.16 + fetch 0.48; 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.51ms; exec 1.49 + fetch 0.02; 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. (2.05ms; exec 2.01 + fetch 0.03; rows 1) SELECT stage_path, evidence_id FROM sejm_process_stages JOIN evidence stage_evidence ON stage_evidence.id = evidence_id …
21. (0.93ms; exec 0.92 + fetch 0.01; rows 0) SELECT object_id, current_revision_id FROM sejm_prints WHERE term = 10 AND print_number = '1294'
22. (0.71ms; exec 0.7 + fetch 0.01; rows 1) SELECT term, bill_number FROM sejm_bills WHERE object_id = 574
23. (1.77ms; exec 1.75 + fetch 0.02; 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. (1.56ms; exec 1.53 + fetch 0.03; 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. (2.96ms; exec 2.92 + fetch 0.03; 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. (1.2ms; exec 1.18 + fetch 0.02; 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. (6.32ms; exec 6.27 + fetch 0.05; 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. (1.08ms; exec 1.06 + 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 …
29. (1.38ms; exec 1.36 + fetch 0.02; 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. (4.31ms; exec 4.28 + fetch 0.03; rows 0) WITH RECURSIVE related_prints (print_id, revision_id, print_number, relation_evidence_id) AS ( SELECT p.object_id, CASE …
31. (11.56ms; exec 11.52 + fetch 0.04; 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.65ms; exec 4.58 + fetch 0.07; 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. (2.74ms; exec 2.62 + fetch 0.11; 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.64ms; exec 2.62 + 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.38ms; exec 1.37 + 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 = 574 AND (NULL IS NULL OR r.id IS NOT NULL)
2. (7.92ms; exec 7.53 + fetch 0.39; 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 = 574
3. (3.87ms; exec 3.4 + 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 (125146,175857,178382,207128,209666,242251,244789,277362,279900,316467,319005,323239,325777,353832,356370,390161,392699,429332,431870,469961,472499,498589,501127,505113,507651,512210,514748,517855,520393,523442,525980,530547,533085,536186,538724,543158,545696,548816,551354,556091,558629,561721,564259,567336,569874,573596,576134,579224,581762,586506,589044,592010,594548,597703,600241,603874,606412,609281,611819,615320,617858,620784,623322,627063,629601,632720,635262)
4. (1.6ms; exec 1.52 + fetch 0.08; rows 14) 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 = 4446 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 = 4446)) ORDER BY s.parent_path IS NOT NULL, s.ordinal
5. (0.74ms; exec 0.73 + fetch 0.01; 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 = 37 AND d.current_revision_id IS NOT NULL ORDER BY d.source_date
6. (0.49ms; exec 0.48 + 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 = 4446
7. (0.82ms; exec 0.75 + fetch 0.07; rows 14) 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 = 3986
8. (1.67ms; exec 1.65 + fetch 0.03; 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 = 37 AND v.voting_number = 75
9. (0.89ms; exec 0.88 + fetch 0.01; 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 = 6187 AND (NULL IS NULL OR f.finished_at <= NULL) ORDER BY re.evidence_id LIMIT 1
10. (0.71ms; exec 0.69 + fetch 0.02; 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 = 6187 AND (NULL IS NULL OR f.finished_at <= NULL)
11. (8.05ms; exec 7.18 + fetch 0.87; 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 = 6187 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.26ms; exec 1.25 + 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 = 574 AND (NULL IS NULL OR r.recorded_at <= NULL) ORDER BY r.revision_no DESC LIMIT 1
13. (0.63ms; exec 0.61 + fetch 0.01; 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 = 574
14. (1.9ms; exec 1.88 + fetch 0.03; 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 = 574 AND l.bill_revision_id = 574 AND (NULL IS NULL OR f.finished_at <= NULL)
15. (0.68ms; exec 0.66 + 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 = 4446
16. (1.05ms; exec 1.04 + 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.96ms; exec 0.94 + fetch 0.02; 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 = 574
18. (2.64ms; exec 2.16 + fetch 0.48; 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 = 574 AND l.bill_revision_id = 574
19. (1.51ms; exec 1.49 + fetch 0.02; 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 = 3986 AND re.field_path = '$' AND f.requested_url = 'https://api.sejm.gov.pl/sejm/term10/processes/1268' 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. (2.05ms; exec 2.01 + fetch 0.03; 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 = 125131 AND process_evidence.fetch_id = stage_evidence.fetch_id WHERE process_revision_id = 3986 AND stage_type = 'CommitteeReport' ORDER BY stage_path
21. (0.93ms; exec 0.92 + fetch 0.01; rows 0) SELECT object_id, current_revision_id FROM sejm_prints WHERE term = 10 AND print_number = '1294'
22. (0.71ms; exec 0.7 + fetch 0.01; rows 1) SELECT term, bill_number FROM sejm_bills WHERE object_id = 574
23. (1.77ms; exec 1.75 + fetch 0.02; 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. (1.56ms; exec 1.53 + fetch 0.03; 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 = 574
25. (2.96ms; exec 2.92 + fetch 0.03; 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 = '1268' ORDER BY p.object_id
26. (1.2ms; exec 1.18 + fetch 0.02; 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 = 574
27. (6.32ms; exec 6.27 + fetch 0.05; 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 = '1268' 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 = 574 AND link.bill_revision_id = 574 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. (1.08ms; exec 1.06 + 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 = 4446
29. (1.38ms; exec 1.36 + fetch 0.02; 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. (4.31ms; exec 4.28 + fetch 0.03; 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 = '1268' 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. (11.56ms; exec 11.52 + fetch 0.04; 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 = 574 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.65ms; exec 4.58 + fetch 0.07; 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 (574,4446) 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. (2.74ms; exec 2.62 + fetch 0.11; 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 (574,3986) GROUP BY re.revision_id, re.evidence_id ORDER BY re.revision_id, re.evidence_id
34. (2.64ms; exec 2.62 + 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 (574) ORDER BY assignment.object_id, topic.name, FIELD(assignment.match_basis, 'eli_keyword', 'fulltext_phrase', 'title_term'), assignment.id