diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 69531773..45c7e10c 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -3,7 +3,7 @@ Васильев Никита, БВТ2301. Целевая оценка5. Трек: План запроса и восстановление. Реализованы обязательный API и все пункты уровня4; методика выбранного исследования, -реальные результаты и ограничения приведены в [REPORT.md](../../REPORT.md). +реальные результаты и ограничения приведены в `REPORT.md`. Команды запуска: `uv sync --locked --python 3.12`, `make up`, `make test`, `make check validate PYTHON=.venv/bin/python`, `make lint test-student`. Подробные проверки отказов и повторение исследования — в отчёте. diff --git a/Makefile b/Makefile index 4e1eb6bd..c6dc0024 100644 --- a/Makefile +++ b/Makefile @@ -46,3 +46,5 @@ lint: student-test test-student: BASE_URL=$(BASE_URL) uv run --locked pytest -q + +.PHONY: up down image lint student-test test-student bootstrap migrate diff --git a/REPORT.md b/REPORT.md index d662aabd..01178a68 100644 --- a/REPORT.md +++ b/REPORT.md @@ -11,7 +11,7 @@ чужие реализации, история и результаты измерений не использованы как собственные. Выбран трек2: **план запроса и восстановление**. -Исходный проект: https://gitea.privcloud.tech/mtusi2026/mtusi2026lab2 +Исходный проект: [задание преподавателя](https://gitea.privcloud.tech/mtusi2026/mtusi2026lab2) Название будущего МР: **ЛР 2 — БВТ2301 — Васильев — на 5**. ## Запуск из чистого clone @@ -43,8 +43,8 @@ uv run --locked python research/run.py --output evidence/query-study-repeat.json uv run --locked python research/analyze.py evidence/query-study-repeat.json ``` -Test override добавляет только отдельную API на127.0.0.1:18082 с TTL2s. Обычный -TTL3600s, для public persistence не меньше300s. Эксперименты отказов запускать +Test override добавляет только отдельную API на127.0.0.1:18082 с TTL 2 s. Обычный +TTL 3600 s, для public persistence не меньше300s. Эксперименты отказов запускать последовательно. Каждому повтору нужен новый evidence-файл. Остановка с сохранением данных: `docker compose -f compose.yaml -f compose.test.yaml down`. @@ -71,7 +71,7 @@ file-backed Compose secret mounts non-root API; в API смонтированы ## Архитектура, схема, транзакции -Клиент → один API → PostgreSQL; Valkey содержит disposable User-карточки с TTL60s. +Клиент → один API → PostgreSQL; Valkey содержит disposable User-карточки с TTL 60 s. Из собственной ЛР1 перенесены маршруты, строгие схемы, ошибки, ACL, cursor и тесты. In-memory adapter заменён на `src/messenger/postgres.py`; добавлены password и сессии. Оригинальные contracts/tests ЛР2 сохранены. Проект не зависит от соседней lab1. @@ -89,8 +89,8 @@ connect2s, statement2.5s, lock1.5s; исчерпание и недоступно История использует `(chat_id,created_at,id)` и keyset, без OFFSET. Чтения autocommit, составные записи в явной транзакции. -Пароли12..128 Unicode code points, без усечения, Argon2id time_cost2, -memory_cost65536KiB, parallelism1, максимум2 KDF одновременно. Basic разбирается +Пароли12..128 Unicode code points, без усечения, Argon2id time_cost=2, +memory_cost=65536 KiB, parallelism=1, максимум2 KDF одновременно. Basic разбирается как UTF-8 по первому двоеточию, только при создании сессии; тело входа игнорируется. Opaque token —32 случайных байта; PostgreSQL хранит SHA-256 token и абсолютный expiry. Каждый защищённый запрос сначала читает сессию из PostgreSQL, затем карточку из @@ -111,7 +111,7 @@ TTL/eviction/flush/restart безопасны. История не кэширу | Valkey реально кэширует, TTL/flush/failure | DBSIZE→flush→repopulate, stop cache | [lifecycle.json](evidence/lifecycle.json) | | SQL/pool/timeouts, гонка username, rollback | собственные HTTP-тесты; verify_pool.py | [tests-final.txt](evidence/tests-final.txt), [pool.json](evidence/pool.json) | | Индекс и EXPLAIN≥10000 | реальный dataset100000 | [query-study-final.json](evidence/query-study-final.json) | -| Автоматические expiry/logout/wrong password/отказы | короткий TTL2s, рестарт short API, stopPG/cache | [lifecycle.json](evidence/lifecycle.json) | +| Автоматические expiry/logout/wrong password/отказы | короткий TTL 2 s, рестарт short API, stopPG/cache | [lifecycle.json](evidence/lifecycle.json) | | Трек5:100k/skew/2индекса/запись/backup/restore | research/run.py | [Методика](research/README.md), [raw](evidence/query-study-final.json), [график](evidence/query-study-final.svg) | | Чистый независимый clone | новый project/secrets/volume | [clean-clone.json](evidence/clean-clone.json) | | Структура, OpenAPI, lint | make check validate lint | [contract-final.txt](evidence/contract-final.txt) | @@ -155,3 +155,12 @@ SQL latency не равна HTTP latency. WAL общий для кластера Источники: исходный контракт, [PostgreSQL](https://www.postgresql.org/docs/17/), [psycopg](https://www.psycopg.org/psycopg3/docs/), [Argon2](https://argon2-cffi.readthedocs.io/), [Valkey](https://valkey.io/topics/). + +## Проверенная версия и итог + +Независимый чистый clone проверен на `35764f730c90f9797925313875be0a484c13dcff`. +Хеши runtime-модулей в контейнере совпали с исходниками. После этой проверки +runtime-код не изменялся; финальные коммиты добавляют только отчёт и evidence. +Локальные проверки выполнены, публикации и удалённого CI пока не было. +Собственные HTTP-тесты: **61 passed**, без пропусков. +Публичный smoke, структура, OpenAPI, lint и существенные отказы прошли. diff --git a/SUBMISSION.md b/SUBMISSION.md new file mode 100644 index 00000000..538154c1 --- /dev/null +++ b/SUBMISSION.md @@ -0,0 +1,18 @@ +# Подготовка к сдаче ЛР2 + +Название МР: **ЛР 2 — БВТ2301 — Васильев — на 5**. +Автор: Васильев Никита, БВТ2301. Ветка: `solution/bvt2301-vasilev`. +Площадка: Gitea. +[Исходный проект](https://gitea.privcloud.tech/mtusi2026/mtusi2026lab2), базовая ветка `master`. + +Работа проверена локально. Собственный fork и МР пока не созданы, +публикация не выполнялась. После предоставления профиля нужно создать +собственный публичный fork именно этого проекта, связать его как origin, +отправить solution-ветку и явно выбранные теги, открыть МР в исходный проект. +Преподавательский upstream предназначен для чтения; его push URL отключён. + +Описание МР: содержимое [.github/pull_request_template.md](.github/pull_request_template.md) +с действительной ссылкой на [REPORT.md](REPORT.md). Нужны публичный доступ, +правильные source/target и title, совпадение remote SHA с локальной веткой. +МР за преподавателя не сливается. Удалённый CI не считается выполненным +по одним локальным результатам. diff --git a/evidence/audit.json b/evidence/audit.json index a0d56845..9476596c 100644 --- a/evidence/audit.json +++ b/evidence/audit.json @@ -1,7 +1,7 @@ { "passed": true, - "candidate_files": 73, - "reachable_objects": 85, + "candidate_files": 80, + "reachable_objects": 109, "required_source_files": { "README.md": "unchanged", "COURSE.md": "unchanged", diff --git a/evidence/clean-clone.json b/evidence/clean-clone.json new file mode 100644 index 00000000..6a0f6b2f --- /dev/null +++ b/evidence/clean-clone.json @@ -0,0 +1,71 @@ +{ + "passed": true, + "source_commit": "35764f730c90f9797925313875be0a484c13dcff", + "source_hashes": { + "messenger/app.py": "d54a8c28491eef19026ab53fb18f66f7fa9ebeeaa3ef7f7d43654fb56a960502", + "messenger/migrate.py": "eb5cad7ac6abe38dd40b2db307d298b297abe9543b3928c36bab8ef06283664e", + "messenger/models.py": "cf44680f8f39228ffc89910577df70354f8d660a6652d62091007cfe074ccbe2", + "messenger/__init__.py": "9a72a49106367ca514cc6147d0e727e62c4d33fefd61572d209a5c9494551a2c", + "messenger/postgres.py": "8e224cbab14872a54abb23937b7d290975d4209779897aaa551e5cb952cb8365", + "messenger/domain.py": "33086cb229083ecee3bcee09f143b4bc09e48896a0c497bd9902e738e2e6b1af", + "messenger/config.py": "e4d4aaf674ede8b5abdc361f77c7793ee94d8d7856030c28834eb7c95291b193", + "messenger/__main__.py": "ba9a59ad44ee8884cd65cf88d5ea15cbd7051b10f7c729043ddd44ca2f34defe" + }, + "image_id": "sha256:e3f29f12c4f5abd90e7fc25187ec0be0d30836c964ce4661b35d3adf28a316f1", + "image_revision": "35764f730c90f9797925313875be0a484c13dcff", + "new_secret_set": true, + "isolated_project": "vasilev-clean-lab2", + "steps": [ + { + "command": "uv sync --locked --python 3.12", + "passed": true, + "seconds": 0.061 + }, + { + "command": "make bootstrap", + "passed": true, + "seconds": 0.03 + }, + { + "command": "docker compose -f compose.yaml -f compose.test.yaml up -d --build --wait", + "passed": true, + "seconds": 9.414 + }, + { + "command": "uv run --locked python research/run.py --output evidence/query-study-final.json", + "passed": true, + "seconds": 5.001 + }, + { + "command": "uv run --locked python research/analyze.py evidence/query-study-final.json", + "passed": true, + "seconds": 0.037 + }, + { + "command": "make check validate lint PYTHON=.venv/bin/python", + "passed": true, + "seconds": 1.373 + }, + { + "command": "make test PUBLIC_PORT=18092", + "passed": true, + "seconds": 0.608 + }, + { + "command": "make test-student PUBLIC_PORT=18092", + "passed": true, + "seconds": 19.274 + }, + { + "command": "python3 scripts/verify_lifecycle.py --base-url http://127.0.0.1:18092 --short-url http://127.0.0.1:28092 --output evidence/lifecycle-clean.json", + "passed": true, + "seconds": 15.829 + }, + { + "command": "python3 scripts/verify_pool.py --output evidence/pool-clean.json", + "passed": true, + "seconds": 3.052 + } + ], + "runtime_unchanged_after_tested_source": true +} diff --git a/evidence/lifecycle-clean.json b/evidence/lifecycle-clean.json new file mode 100644 index 00000000..8c804ba5 --- /dev/null +++ b/evidence/lifecycle-clean.json @@ -0,0 +1,63 @@ +{ + "date_utc": "2026-10-30T14:32:25.833684+00:00", + "passed": true, + "public_persistence": "Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.\nPASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.", + "before": { + "api": { + "cid": "feedf7c348932793dda9b1f24db94c9af73053d95cf49608b62be69768a486c2", + "pid": 29220, + "started_at": "2026-10-30T14:31:53.619517906Z" + }, + "cache": { + "cid": "abf39e834915df8c38729bbef9e990551831e925a59824ef13e0b07a608724c5", + "pid": 28778, + "started_at": "2026-10-30T14:31:50.484820839Z" + }, + "postgres": { + "cid": "ef3c2a78d4db5f93e3c2b79aad28e972460127231b6e39ae6120a4d9acf7c8c0", + "pid": 28777, + "started_at": "2026-10-30T14:31:50.485089224Z" + } + }, + "after": { + "api": { + "cid": "feedf7c348932793dda9b1f24db94c9af73053d95cf49608b62be69768a486c2", + "pid": 32006, + "started_at": "2026-10-30T14:32:27.197264989Z" + }, + "cache": { + "cid": "abf39e834915df8c38729bbef9e990551831e925a59824ef13e0b07a608724c5", + "pid": 31862, + "started_at": "2026-10-30T14:32:27.001543385Z" + }, + "postgres": { + "cid": "ef3c2a78d4db5f93e3c2b79aad28e972460127231b6e39ae6120a4d9acf7c8c0", + "pid": 31777, + "started_at": "2026-10-30T14:32:26.935843635Z" + } + }, + "same_token_and_message_after_restart": true, + "cache_flush_repopulates": true, + "cache_failure": { + "authenticated_status": 200, + "anonymous_status": 401, + "seconds": 0.0051 + }, + "database_failure": { + "cached_actor_status": 503, + "ready_status": 503, + "live_status": 200, + "seconds": 2.0111 + }, + "session_after_database_recovery": true, + "failed_chat_transaction_left_rows": 0, + "migrations_reapplied_twice": true, + "expiry": { + "configured_ttl_seconds": 2, + "observed_after_seconds": 2.4192, + "expired_status": 401, + "short_api_restarted_before_check": true + }, + "logout_with_cached_user": 401, + "credentials_absent_from_api_logs": true +} diff --git a/evidence/pool-clean.json b/evidence/pool-clean.json new file mode 100644 index 00000000..e8119915 --- /dev/null +++ b/evidence/pool-clean.json @@ -0,0 +1,212 @@ +{ + "passed": true, + "clients": 50, + "max_pool_size": 8, + "max_waiting": 32, + "admitted": 8, + "rejected_503": 42, + "max_seconds": 2.225532210955862, + "rows": [ + { + "status": 503, + "seconds": 2.0021635820157826 + }, + { + "status": 503, + "seconds": 1.4174031093716621e-05 + }, + { + "status": 503, + "seconds": 2.0020112140337005 + }, + { + "status": 503, + "seconds": 4.960980731993914e-06 + }, + { + "status": 503, + "seconds": 2.0019857849692926 + }, + { + "status": 503, + "seconds": 1.729995710775256e-05 + }, + { + "status": 503, + "seconds": 2.0002509180339985 + }, + { + "status": 503, + "seconds": 2.002100343001075 + }, + { + "status": 503, + "seconds": 2.0020874189794995 + }, + { + "status": 503, + "seconds": 2.0020374360028654 + }, + { + "status": 503, + "seconds": 1.0297051630914211e-05 + }, + { + "status": 200, + "seconds": 2.2069947799900547 + }, + { + "status": 200, + "seconds": 2.2116657389560714 + }, + { + "status": 200, + "seconds": 2.218611836025957 + }, + { + "status": 200, + "seconds": 2.211599581001792 + }, + { + "status": 200, + "seconds": 2.2174383330275305 + }, + { + "status": 503, + "seconds": 3.5440316423773766e-06 + }, + { + "status": 503, + "seconds": 2.002133609028533 + }, + { + "status": 503, + "seconds": 2.0019869100069627 + }, + { + "status": 503, + "seconds": 2.0020533190108836 + }, + { + "status": 503, + "seconds": 2.002086877997499 + }, + { + "status": 503, + "seconds": 2.002052652009297 + }, + { + "status": 503, + "seconds": 2.0019422639743425 + }, + { + "status": 503, + "seconds": 2.002054319018498 + }, + { + "status": 503, + "seconds": 2.0019010339747183 + }, + { + "status": 503, + "seconds": 2.0022103139781393 + }, + { + "status": 503, + "seconds": 2.0021815079962835 + }, + { + "status": 503, + "seconds": 2.0008202450117096 + }, + { + "status": 503, + "seconds": 2.002282141998876 + }, + { + "status": 503, + "seconds": 2.0022370780352503 + }, + { + "status": 503, + "seconds": 2.0022053119610064 + }, + { + "status": 503, + "seconds": 2.0022150659933686 + }, + { + "status": 503, + "seconds": 2.0022375360131264 + }, + { + "status": 503, + "seconds": 2.0022462070337497 + }, + { + "status": 503, + "seconds": 2.046796726062894e-05 + }, + { + "status": 503, + "seconds": 1.2798001989722252e-05 + }, + { + "status": 503, + "seconds": 2.002062240964733 + }, + { + "status": 200, + "seconds": 2.222286756034009 + }, + { + "status": 200, + "seconds": 2.225532210955862 + }, + { + "status": 503, + "seconds": 7.503957021981478e-06 + }, + { + "status": 503, + "seconds": 8.045986760407686e-06 + }, + { + "status": 503, + "seconds": 3.0440278351306915e-06 + }, + { + "status": 503, + "seconds": 7.921014912426472e-06 + }, + { + "status": 503, + "seconds": 5.376990884542465e-06 + }, + { + "status": 503, + "seconds": 2.7510104700922966e-06 + }, + { + "status": 503, + "seconds": 7.003021892160177e-06 + }, + { + "status": 503, + "seconds": 7.421011105179787e-06 + }, + { + "status": 503, + "seconds": 3.0850060284137726e-06 + }, + { + "status": 503, + "seconds": 2.6259804144501686e-06 + }, + { + "status": 200, + "seconds": 2.2048024350078776 + } + ], + "date_utc": "2026-10-30T14:32:44.301114+00:00" +} diff --git a/evidence/query-study-final-summary.md b/evidence/query-study-final-summary.md new file mode 100644 index 00000000..ac349e9e --- /dev/null +++ b/evidence/query-study-final-summary.md @@ -0,0 +1,26 @@ +# Итог исследования ЛР2: план запроса и восстановление + +Источник: [неизменённые raw-данные](query-study-final.json). +Измерено из чистого clone `35764f730c90f9797925313875be0a484c13dcff`, рабочий каталог в начале опыта чистый. + +| Метрика | Индекс chat_id | Индекс (chat_id,created_at,id) | +|---|---:|---:| +| Медиана SQL, мс | 3.215 | 0.013 | +| Размер индекса, bytes | 720,896 | 5,914,624 | +| Медиана INSERT 5000 + COMMIT, с | 0.06902 | 0.03764 | +| Медиана прироста WAL для 5000 записей, bytes | 1,408,792 | 1,776,184 | + +На выбранной глубокой странице составной индекс сокращает SQL-время примерно +в 247.3 раза, ценой большего индекса +и WAL в этой серии. Это сравнение прогретого SQL, а не HTTP API. +Более короткое время вставки в трёх опытах не доказывает общего ускорения записи: +кэш, checkpoint, порядок измерений и короткая длительность влияют на результат. + +Backup `pg_dump -Fc`: 3,003,381 bytes, 0.248 с. +Restore `pg_restore` в новую БД: 0.401 с. +Совпали количества всех пяти таблиц, 20 выбранных полных сообщений и checksum +всех 100 000 сообщений. Обе созданные исследовательские БД удалены. + +Backup — снимок; изменения после него не входят в восстановление. Без WAL-архивации +и PITR нельзя обещать нулевую потерю данных. Время не включает доставку backup, +замену сервера и переключение клиентов. Подробная [методика](../research/README.md). diff --git a/evidence/query-study-final.json b/evidence/query-study-final.json new file mode 100644 index 00000000..da7bfc8a --- /dev/null +++ b/evidence/query-study-final.json @@ -0,0 +1,4949 @@ +{ + "started_utc": "2026-10-30T14:31:59.239276+00:00", + "databases": { + "original": "research_88185fa70f49", + "restored": "restored_88185fa70f49" + }, + "command": "uv run --locked python research/run.py --output evidence/query-study-final.json", + "method": "Single PostgreSQL container, warmed SQL reads; not HTTP latency", + "repeats_per_index": 3, + "read_trials_per_phase": 7, + "warmup_queries_per_phase": 5, + "source_commit": "35764f730c90f9797925313875be0a484c13dcff", + "source_worktree_dirty": false, + "postgres_container": { + "id": "ef3c2a78d4db5f93e3c2b79aad28e972460127231b6e39ae6120a4d9acf7c8c0", + "image_id": "sha256:742f40ea20b9ff2ff31db5458d127452988a2164df9e17441e191f3b72252193", + "nano_cpus": 1000000000, + "memory_limit_bytes": 805306368 + }, + "study": { + "seed_seconds": 0.9350026850006543, + "rows": 100000, + "schema_sha256": "5d88cd12ef9fda008832dc0b886fa0cf5d886738fe9b77180cdc65adac50dfd9", + "distribution": [ + { + "title": "research chat 1", + "messages": 80000 + }, + { + "title": "research chat 2", + "messages": 15000 + }, + { + "title": "research chat 10", + "messages": 625 + }, + { + "title": "research chat 9", + "messages": 625 + }, + { + "title": "research chat 4", + "messages": 625 + }, + { + "title": "research chat 8", + "messages": 625 + }, + { + "title": "research chat 6", + "messages": 625 + }, + { + "title": "research chat 3", + "messages": 625 + }, + { + "title": "research chat 7", + "messages": 625 + }, + { + "title": "research chat 5", + "messages": 625 + } + ], + "query": "SELECT id,chat_id,sender_id,text,created_at FROM messages WHERE chat_id=md5('chat-1')::uuid AND (created_at,id)>(%s,%s) ORDER BY created_at,id LIMIT 51", + "cursor_position": 60000, + "settings": [ + { + "name": "fsync", + "setting": "on" + }, + { + "name": "full_page_writes", + "setting": "on" + }, + { + "name": "max_connections", + "setting": "100" + }, + { + "name": "server_version", + "setting": "17.10" + }, + { + "name": "shared_buffers", + "setting": "16384" + }, + { + "name": "synchronous_commit", + "setting": "on" + }, + { + "name": "work_mem", + "setting": "4096" + } + ], + "phases": [ + { + "repeat": 1, + "variant": "chat_only", + "plans": [ + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3995.6, + "Total Cost": 4001.47, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 3.398, + "Actual Total Time": 3.548, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 1349, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Gather Merge", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3995.6, + "Total Cost": 6174.74, + "Plan Rows": 18949, + "Plan Width": 79, + "Actual Startup Time": 3.398, + "Actual Total Time": 3.546, + "Actual Rows": 51, + "Actual Loops": 1, + "Workers Planned": 1, + "Workers Launched": 1, + "Shared Hit Blocks": 1349, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Sort", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 2995.59, + "Total Cost": 3042.96, + "Plan Rows": 18949, + "Plan Width": 79, + "Actual Startup Time": 2.024, + "Actual Total Time": 2.025, + "Actual Rows": 26, + "Actual Loops": 2, + "Sort Key": [ + "created_at", + "id" + ], + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory", + "Shared Hit Blocks": 1349, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [ + { + "Worker Number": 0, + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory" + } + ], + "Plans": [ + { + "Node Type": "Seq Scan", + "Parent Relationship": "Outer", + "Parallel Aware": true, + "Async Capable": false, + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.0, + "Total Cost": 2363.41, + "Plan Rows": 18949, + "Plan Width": 79, + "Actual Startup Time": 0.825, + "Actual Total Time": 1.651, + "Actual Rows": 10000, + "Actual Loops": 2, + "Filter": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Filter": 40000, + "Shared Hit Blocks": 1334, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [] + } + ] + } + ] + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.057, + "Triggers": [], + "Execution Time": 3.563 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3995.6, + "Total Cost": 4001.47, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.944, + "Actual Total Time": 3.751, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 1349, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Gather Merge", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3995.6, + "Total Cost": 6174.74, + "Plan Rows": 18949, + "Plan Width": 79, + "Actual Startup Time": 2.944, + "Actual Total Time": 3.749, + "Actual Rows": 51, + "Actual Loops": 1, + "Workers Planned": 1, + "Workers Launched": 1, + "Shared Hit Blocks": 1349, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Sort", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 2995.59, + "Total Cost": 3042.96, + "Plan Rows": 18949, + "Plan Width": 79, + "Actual Startup Time": 1.97, + "Actual Total Time": 1.971, + "Actual Rows": 51, + "Actual Loops": 2, + "Sort Key": [ + "created_at", + "id" + ], + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory", + "Shared Hit Blocks": 1349, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [ + { + "Worker Number": 0, + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory" + } + ], + "Plans": [ + { + "Node Type": "Seq Scan", + "Parent Relationship": "Outer", + "Parallel Aware": true, + "Async Capable": false, + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.0, + "Total Cost": 2363.41, + "Plan Rows": 18949, + "Plan Width": 79, + "Actual Startup Time": 0.778, + "Actual Total Time": 1.545, + "Actual Rows": 10000, + "Actual Loops": 2, + "Filter": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Filter": 40000, + "Shared Hit Blocks": 1334, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [] + } + ] + } + ] + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.037, + "Triggers": [], + "Execution Time": 3.764 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3995.6, + "Total Cost": 4001.47, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.927, + "Actual Total Time": 3.676, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 1349, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Gather Merge", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3995.6, + "Total Cost": 6174.74, + "Plan Rows": 18949, + "Plan Width": 79, + "Actual Startup Time": 2.927, + "Actual Total Time": 3.673, + "Actual Rows": 51, + "Actual Loops": 1, + "Workers Planned": 1, + "Workers Launched": 1, + "Shared Hit Blocks": 1349, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Sort", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 2995.59, + "Total Cost": 3042.96, + "Plan Rows": 18949, + "Plan Width": 79, + "Actual Startup Time": 2.138, + "Actual Total Time": 2.139, + "Actual Rows": 26, + "Actual Loops": 2, + "Sort Key": [ + "created_at", + "id" + ], + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory", + "Shared Hit Blocks": 1349, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [ + { + "Worker Number": 0, + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory" + } + ], + "Plans": [ + { + "Node Type": "Seq Scan", + "Parent Relationship": "Outer", + "Parallel Aware": true, + "Async Capable": false, + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.0, + "Total Cost": 2363.41, + "Plan Rows": 18949, + "Plan Width": 79, + "Actual Startup Time": 0.978, + "Actual Total Time": 1.743, + "Actual Rows": 10000, + "Actual Loops": 2, + "Filter": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Filter": 40000, + "Shared Hit Blocks": 1334, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [] + } + ] + } + ] + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.041, + "Triggers": [], + "Execution Time": 3.687 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3995.6, + "Total Cost": 4001.47, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.476, + "Actual Total Time": 3.198, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 1349, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Gather Merge", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3995.6, + "Total Cost": 6174.74, + "Plan Rows": 18949, + "Plan Width": 79, + "Actual Startup Time": 2.476, + "Actual Total Time": 3.194, + "Actual Rows": 51, + "Actual Loops": 1, + "Workers Planned": 1, + "Workers Launched": 1, + "Shared Hit Blocks": 1349, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Sort", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 2995.59, + "Total Cost": 3042.96, + "Plan Rows": 18949, + "Plan Width": 79, + "Actual Startup Time": 1.758, + "Actual Total Time": 1.76, + "Actual Rows": 51, + "Actual Loops": 2, + "Sort Key": [ + "created_at", + "id" + ], + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory", + "Shared Hit Blocks": 1349, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [ + { + "Worker Number": 0, + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory" + } + ], + "Plans": [ + { + "Node Type": "Seq Scan", + "Parent Relationship": "Outer", + "Parallel Aware": true, + "Async Capable": false, + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.0, + "Total Cost": 2363.41, + "Plan Rows": 18949, + "Plan Width": 79, + "Actual Startup Time": 0.725, + "Actual Total Time": 1.382, + "Actual Rows": 10000, + "Actual Loops": 2, + "Filter": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Filter": 40000, + "Shared Hit Blocks": 1334, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [] + } + ] + } + ] + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.029, + "Triggers": [], + "Execution Time": 3.215 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3995.6, + "Total Cost": 4001.47, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.494, + "Actual Total Time": 3.181, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 1349, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Gather Merge", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3995.6, + "Total Cost": 6174.74, + "Plan Rows": 18949, + "Plan Width": 79, + "Actual Startup Time": 2.494, + "Actual Total Time": 3.178, + "Actual Rows": 51, + "Actual Loops": 1, + "Workers Planned": 1, + "Workers Launched": 1, + "Shared Hit Blocks": 1349, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Sort", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 2995.59, + "Total Cost": 3042.96, + "Plan Rows": 18949, + "Plan Width": 79, + "Actual Startup Time": 1.852, + "Actual Total Time": 1.854, + "Actual Rows": 51, + "Actual Loops": 2, + "Sort Key": [ + "created_at", + "id" + ], + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory", + "Shared Hit Blocks": 1349, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [ + { + "Worker Number": 0, + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory" + } + ], + "Plans": [ + { + "Node Type": "Seq Scan", + "Parent Relationship": "Outer", + "Parallel Aware": true, + "Async Capable": false, + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.0, + "Total Cost": 2363.41, + "Plan Rows": 18949, + "Plan Width": 79, + "Actual Startup Time": 0.74, + "Actual Total Time": 1.481, + "Actual Rows": 10000, + "Actual Loops": 2, + "Filter": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Filter": 40000, + "Shared Hit Blocks": 1334, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [] + } + ] + } + ] + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.027, + "Triggers": [], + "Execution Time": 3.191 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3995.6, + "Total Cost": 4001.47, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.463, + "Actual Total Time": 3.133, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 1349, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Gather Merge", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3995.6, + "Total Cost": 6174.74, + "Plan Rows": 18949, + "Plan Width": 79, + "Actual Startup Time": 2.462, + "Actual Total Time": 3.131, + "Actual Rows": 51, + "Actual Loops": 1, + "Workers Planned": 1, + "Workers Launched": 1, + "Shared Hit Blocks": 1349, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Sort", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 2995.59, + "Total Cost": 3042.96, + "Plan Rows": 18949, + "Plan Width": 79, + "Actual Startup Time": 1.856, + "Actual Total Time": 1.856, + "Actual Rows": 26, + "Actual Loops": 2, + "Sort Key": [ + "created_at", + "id" + ], + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory", + "Shared Hit Blocks": 1349, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [ + { + "Worker Number": 0, + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory" + } + ], + "Plans": [ + { + "Node Type": "Seq Scan", + "Parent Relationship": "Outer", + "Parallel Aware": true, + "Async Capable": false, + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.0, + "Total Cost": 2363.41, + "Plan Rows": 18949, + "Plan Width": 79, + "Actual Startup Time": 0.752, + "Actual Total Time": 1.471, + "Actual Rows": 10000, + "Actual Loops": 2, + "Filter": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Filter": 40000, + "Shared Hit Blocks": 1334, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [] + } + ] + } + ] + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.021, + "Triggers": [], + "Execution Time": 3.146 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3995.6, + "Total Cost": 4001.47, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.409, + "Actual Total Time": 3.1, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 1349, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Gather Merge", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3995.6, + "Total Cost": 6174.74, + "Plan Rows": 18949, + "Plan Width": 79, + "Actual Startup Time": 2.409, + "Actual Total Time": 3.097, + "Actual Rows": 51, + "Actual Loops": 1, + "Workers Planned": 1, + "Workers Launched": 1, + "Shared Hit Blocks": 1349, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Sort", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 2995.59, + "Total Cost": 3042.96, + "Plan Rows": 18949, + "Plan Width": 79, + "Actual Startup Time": 1.753, + "Actual Total Time": 1.758, + "Actual Rows": 51, + "Actual Loops": 2, + "Sort Key": [ + "created_at", + "id" + ], + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory", + "Shared Hit Blocks": 1349, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [ + { + "Worker Number": 0, + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory" + } + ], + "Plans": [ + { + "Node Type": "Seq Scan", + "Parent Relationship": "Outer", + "Parallel Aware": true, + "Async Capable": false, + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.0, + "Total Cost": 2363.41, + "Plan Rows": 18949, + "Plan Width": 79, + "Actual Startup Time": 0.728, + "Actual Total Time": 1.383, + "Actual Rows": 10000, + "Actual Loops": 2, + "Filter": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Filter": 40000, + "Shared Hit Blocks": 1334, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [] + } + ] + } + ] + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.018, + "Triggers": [], + "Execution Time": 3.109 + } + ], + "index_bytes_before_write": 720896, + "insert_rows": 5000, + "insert_commit_seconds": 0.03691590699600056, + "insert_wal_bytes": 1463664 + }, + { + "repeat": 1, + "variant": "composite", + "plans": [ + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.42, + "Total Cost": 7.54, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 0.005, + "Actual Total Time": 0.009, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Index Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Scan Direction": "Forward", + "Index Name": "research_history_idx", + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.42, + "Total Cost": 4478.76, + "Plan Rows": 32054, + "Plan Width": 79, + "Actual Startup Time": 0.005, + "Actual Total Time": 0.007, + "Actual Rows": 51, + "Actual Loops": 1, + "Index Cond": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Index Recheck": 0, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.012, + "Triggers": [], + "Execution Time": 0.013 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.42, + "Total Cost": 7.54, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 0.005, + "Actual Total Time": 0.008, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Index Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Scan Direction": "Forward", + "Index Name": "research_history_idx", + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.42, + "Total Cost": 4478.76, + "Plan Rows": 32054, + "Plan Width": 79, + "Actual Startup Time": 0.005, + "Actual Total Time": 0.006, + "Actual Rows": 51, + "Actual Loops": 1, + "Index Cond": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Index Recheck": 0, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.013, + "Triggers": [], + "Execution Time": 0.013 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.42, + "Total Cost": 7.54, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 0.005, + "Actual Total Time": 0.008, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Index Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Scan Direction": "Forward", + "Index Name": "research_history_idx", + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.42, + "Total Cost": 4478.76, + "Plan Rows": 32054, + "Plan Width": 79, + "Actual Startup Time": 0.005, + "Actual Total Time": 0.007, + "Actual Rows": 51, + "Actual Loops": 1, + "Index Cond": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Index Recheck": 0, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.012, + "Triggers": [], + "Execution Time": 0.013 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.42, + "Total Cost": 7.54, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 0.005, + "Actual Total Time": 0.008, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Index Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Scan Direction": "Forward", + "Index Name": "research_history_idx", + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.42, + "Total Cost": 4478.76, + "Plan Rows": 32054, + "Plan Width": 79, + "Actual Startup Time": 0.005, + "Actual Total Time": 0.006, + "Actual Rows": 51, + "Actual Loops": 1, + "Index Cond": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Index Recheck": 0, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.012, + "Triggers": [], + "Execution Time": 0.013 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.42, + "Total Cost": 7.54, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 0.005, + "Actual Total Time": 0.009, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Index Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Scan Direction": "Forward", + "Index Name": "research_history_idx", + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.42, + "Total Cost": 4478.76, + "Plan Rows": 32054, + "Plan Width": 79, + "Actual Startup Time": 0.005, + "Actual Total Time": 0.007, + "Actual Rows": 51, + "Actual Loops": 1, + "Index Cond": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Index Recheck": 0, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.012, + "Triggers": [], + "Execution Time": 0.014 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.42, + "Total Cost": 7.54, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 0.004, + "Actual Total Time": 0.008, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Index Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Scan Direction": "Forward", + "Index Name": "research_history_idx", + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.42, + "Total Cost": 4478.76, + "Plan Rows": 32054, + "Plan Width": 79, + "Actual Startup Time": 0.004, + "Actual Total Time": 0.006, + "Actual Rows": 51, + "Actual Loops": 1, + "Index Cond": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Index Recheck": 0, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.009, + "Triggers": [], + "Execution Time": 0.012 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.42, + "Total Cost": 7.54, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 0.004, + "Actual Total Time": 0.008, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Index Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Scan Direction": "Forward", + "Index Name": "research_history_idx", + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.42, + "Total Cost": 4478.76, + "Plan Rows": 32054, + "Plan Width": 79, + "Actual Startup Time": 0.004, + "Actual Total Time": 0.006, + "Actual Rows": 51, + "Actual Loops": 1, + "Index Cond": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Index Recheck": 0, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.009, + "Triggers": [], + "Execution Time": 0.011 + } + ], + "index_bytes_before_write": 5914624, + "insert_rows": 5000, + "insert_commit_seconds": 0.04123339802026749, + "insert_wal_bytes": 1776184 + }, + { + "repeat": 2, + "variant": "composite", + "plans": [ + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.42, + "Total Cost": 7.53, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 0.005, + "Actual Total Time": 0.01, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Index Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Scan Direction": "Forward", + "Index Name": "research_history_idx", + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.42, + "Total Cost": 4477.32, + "Plan Rows": 32109, + "Plan Width": 79, + "Actual Startup Time": 0.005, + "Actual Total Time": 0.007, + "Actual Rows": 51, + "Actual Loops": 1, + "Index Cond": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Index Recheck": 0, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.019, + "Triggers": [], + "Execution Time": 0.015 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.42, + "Total Cost": 7.53, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 0.004, + "Actual Total Time": 0.008, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Index Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Scan Direction": "Forward", + "Index Name": "research_history_idx", + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.42, + "Total Cost": 4477.32, + "Plan Rows": 32109, + "Plan Width": 79, + "Actual Startup Time": 0.004, + "Actual Total Time": 0.006, + "Actual Rows": 51, + "Actual Loops": 1, + "Index Cond": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Index Recheck": 0, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.012, + "Triggers": [], + "Execution Time": 0.013 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.42, + "Total Cost": 7.53, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 0.004, + "Actual Total Time": 0.008, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Index Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Scan Direction": "Forward", + "Index Name": "research_history_idx", + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.42, + "Total Cost": 4477.32, + "Plan Rows": 32109, + "Plan Width": 79, + "Actual Startup Time": 0.004, + "Actual Total Time": 0.006, + "Actual Rows": 51, + "Actual Loops": 1, + "Index Cond": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Index Recheck": 0, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.011, + "Triggers": [], + "Execution Time": 0.013 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.42, + "Total Cost": 7.53, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 0.004, + "Actual Total Time": 0.008, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Index Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Scan Direction": "Forward", + "Index Name": "research_history_idx", + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.42, + "Total Cost": 4477.32, + "Plan Rows": 32109, + "Plan Width": 79, + "Actual Startup Time": 0.004, + "Actual Total Time": 0.006, + "Actual Rows": 51, + "Actual Loops": 1, + "Index Cond": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Index Recheck": 0, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.01, + "Triggers": [], + "Execution Time": 0.012 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.42, + "Total Cost": 7.53, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 0.004, + "Actual Total Time": 0.008, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Index Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Scan Direction": "Forward", + "Index Name": "research_history_idx", + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.42, + "Total Cost": 4477.32, + "Plan Rows": 32109, + "Plan Width": 79, + "Actual Startup Time": 0.004, + "Actual Total Time": 0.006, + "Actual Rows": 51, + "Actual Loops": 1, + "Index Cond": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Index Recheck": 0, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.01, + "Triggers": [], + "Execution Time": 0.012 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.42, + "Total Cost": 7.53, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 0.004, + "Actual Total Time": 0.008, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Index Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Scan Direction": "Forward", + "Index Name": "research_history_idx", + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.42, + "Total Cost": 4477.32, + "Plan Rows": 32109, + "Plan Width": 79, + "Actual Startup Time": 0.004, + "Actual Total Time": 0.006, + "Actual Rows": 51, + "Actual Loops": 1, + "Index Cond": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Index Recheck": 0, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.009, + "Triggers": [], + "Execution Time": 0.013 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.42, + "Total Cost": 7.53, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 0.004, + "Actual Total Time": 0.008, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Index Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Scan Direction": "Forward", + "Index Name": "research_history_idx", + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.42, + "Total Cost": 4477.32, + "Plan Rows": 32109, + "Plan Width": 79, + "Actual Startup Time": 0.004, + "Actual Total Time": 0.006, + "Actual Rows": 51, + "Actual Loops": 1, + "Index Cond": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Index Recheck": 0, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.009, + "Triggers": [], + "Execution Time": 0.012 + } + ], + "index_bytes_before_write": 5914624, + "insert_rows": 5000, + "insert_commit_seconds": 0.03699202899588272, + "insert_wal_bytes": 1776184 + }, + { + "repeat": 2, + "variant": "chat_only", + "plans": [ + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4063.0, + "Total Cost": 4068.87, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.407, + "Actual Total Time": 3.093, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Gather Merge", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4063.0, + "Total Cost": 6246.97, + "Plan Rows": 18991, + "Plan Width": 79, + "Actual Startup Time": 2.406, + "Actual Total Time": 3.091, + "Actual Rows": 51, + "Actual Loops": 1, + "Workers Planned": 1, + "Workers Launched": 1, + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Sort", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3062.99, + "Total Cost": 3110.47, + "Plan Rows": 18991, + "Plan Width": 79, + "Actual Startup Time": 1.77, + "Actual Total Time": 1.77, + "Actual Rows": 26, + "Actual Loops": 2, + "Sort Key": [ + "created_at", + "id" + ], + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory", + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [ + { + "Worker Number": 0, + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory" + } + ], + "Plans": [ + { + "Node Type": "Seq Scan", + "Parent Relationship": "Outer", + "Parallel Aware": true, + "Async Capable": false, + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.0, + "Total Cost": 2429.41, + "Plan Rows": 18991, + "Plan Width": 79, + "Actual Startup Time": 0.712, + "Actual Total Time": 1.385, + "Actual Rows": 10000, + "Actual Loops": 2, + "Filter": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Filter": 40000, + "Shared Hit Blocks": 1400, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [] + } + ] + } + ] + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.015, + "Triggers": [], + "Execution Time": 3.101 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4063.0, + "Total Cost": 4068.87, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.41, + "Actual Total Time": 3.04, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Gather Merge", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4063.0, + "Total Cost": 6246.97, + "Plan Rows": 18991, + "Plan Width": 79, + "Actual Startup Time": 2.41, + "Actual Total Time": 3.038, + "Actual Rows": 51, + "Actual Loops": 1, + "Workers Planned": 1, + "Workers Launched": 1, + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Sort", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3062.99, + "Total Cost": 3110.47, + "Plan Rows": 18991, + "Plan Width": 79, + "Actual Startup Time": 1.796, + "Actual Total Time": 1.798, + "Actual Rows": 51, + "Actual Loops": 2, + "Sort Key": [ + "created_at", + "id" + ], + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory", + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [ + { + "Worker Number": 0, + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory" + } + ], + "Plans": [ + { + "Node Type": "Seq Scan", + "Parent Relationship": "Outer", + "Parallel Aware": true, + "Async Capable": false, + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.0, + "Total Cost": 2429.41, + "Plan Rows": 18991, + "Plan Width": 79, + "Actual Startup Time": 0.744, + "Actual Total Time": 1.42, + "Actual Rows": 10000, + "Actual Loops": 2, + "Filter": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Filter": 40000, + "Shared Hit Blocks": 1400, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [] + } + ] + } + ] + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.016, + "Triggers": [], + "Execution Time": 3.047 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4063.0, + "Total Cost": 4068.87, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.423, + "Actual Total Time": 3.074, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Gather Merge", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4063.0, + "Total Cost": 6246.97, + "Plan Rows": 18991, + "Plan Width": 79, + "Actual Startup Time": 2.422, + "Actual Total Time": 3.072, + "Actual Rows": 51, + "Actual Loops": 1, + "Workers Planned": 1, + "Workers Launched": 1, + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Sort", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3062.99, + "Total Cost": 3110.47, + "Plan Rows": 18991, + "Plan Width": 79, + "Actual Startup Time": 1.741, + "Actual Total Time": 1.743, + "Actual Rows": 51, + "Actual Loops": 2, + "Sort Key": [ + "created_at", + "id" + ], + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory", + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [ + { + "Worker Number": 0, + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory" + } + ], + "Plans": [ + { + "Node Type": "Seq Scan", + "Parent Relationship": "Outer", + "Parallel Aware": true, + "Async Capable": false, + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.0, + "Total Cost": 2429.41, + "Plan Rows": 18991, + "Plan Width": 79, + "Actual Startup Time": 0.705, + "Actual Total Time": 1.367, + "Actual Rows": 10000, + "Actual Loops": 2, + "Filter": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Filter": 40000, + "Shared Hit Blocks": 1400, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [] + } + ] + } + ] + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.019, + "Triggers": [], + "Execution Time": 3.083 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4063.0, + "Total Cost": 4068.87, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.384, + "Actual Total Time": 3.023, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Gather Merge", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4063.0, + "Total Cost": 6246.97, + "Plan Rows": 18991, + "Plan Width": 79, + "Actual Startup Time": 2.384, + "Actual Total Time": 3.021, + "Actual Rows": 51, + "Actual Loops": 1, + "Workers Planned": 1, + "Workers Launched": 1, + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Sort", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3062.99, + "Total Cost": 3110.47, + "Plan Rows": 18991, + "Plan Width": 79, + "Actual Startup Time": 1.791, + "Actual Total Time": 1.792, + "Actual Rows": 51, + "Actual Loops": 2, + "Sort Key": [ + "created_at", + "id" + ], + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory", + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [ + { + "Worker Number": 0, + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory" + } + ], + "Plans": [ + { + "Node Type": "Seq Scan", + "Parent Relationship": "Outer", + "Parallel Aware": true, + "Async Capable": false, + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.0, + "Total Cost": 2429.41, + "Plan Rows": 18991, + "Plan Width": 79, + "Actual Startup Time": 0.723, + "Actual Total Time": 1.396, + "Actual Rows": 10000, + "Actual Loops": 2, + "Filter": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Filter": 40000, + "Shared Hit Blocks": 1400, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [] + } + ] + } + ] + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.018, + "Triggers": [], + "Execution Time": 3.031 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4063.0, + "Total Cost": 4068.87, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.393, + "Actual Total Time": 3.084, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Gather Merge", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4063.0, + "Total Cost": 6246.97, + "Plan Rows": 18991, + "Plan Width": 79, + "Actual Startup Time": 2.393, + "Actual Total Time": 3.077, + "Actual Rows": 51, + "Actual Loops": 1, + "Workers Planned": 1, + "Workers Launched": 1, + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Sort", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3062.99, + "Total Cost": 3110.47, + "Plan Rows": 18991, + "Plan Width": 79, + "Actual Startup Time": 1.8, + "Actual Total Time": 1.801, + "Actual Rows": 26, + "Actual Loops": 2, + "Sort Key": [ + "created_at", + "id" + ], + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory", + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [ + { + "Worker Number": 0, + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory" + } + ], + "Plans": [ + { + "Node Type": "Seq Scan", + "Parent Relationship": "Outer", + "Parallel Aware": true, + "Async Capable": false, + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.0, + "Total Cost": 2429.41, + "Plan Rows": 18991, + "Plan Width": 79, + "Actual Startup Time": 0.724, + "Actual Total Time": 1.407, + "Actual Rows": 10000, + "Actual Loops": 2, + "Filter": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Filter": 40000, + "Shared Hit Blocks": 1400, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [] + } + ] + } + ] + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.016, + "Triggers": [], + "Execution Time": 3.095 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4063.0, + "Total Cost": 4068.87, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.567, + "Actual Total Time": 3.342, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Gather Merge", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4063.0, + "Total Cost": 6246.97, + "Plan Rows": 18991, + "Plan Width": 79, + "Actual Startup Time": 2.567, + "Actual Total Time": 3.34, + "Actual Rows": 51, + "Actual Loops": 1, + "Workers Planned": 1, + "Workers Launched": 1, + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Sort", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3062.99, + "Total Cost": 3110.47, + "Plan Rows": 18991, + "Plan Width": 79, + "Actual Startup Time": 1.92, + "Actual Total Time": 1.921, + "Actual Rows": 51, + "Actual Loops": 2, + "Sort Key": [ + "created_at", + "id" + ], + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory", + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [ + { + "Worker Number": 0, + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory" + } + ], + "Plans": [ + { + "Node Type": "Seq Scan", + "Parent Relationship": "Outer", + "Parallel Aware": true, + "Async Capable": false, + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.0, + "Total Cost": 2429.41, + "Plan Rows": 18991, + "Plan Width": 79, + "Actual Startup Time": 0.803, + "Actual Total Time": 1.52, + "Actual Rows": 10000, + "Actual Loops": 2, + "Filter": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Filter": 40000, + "Shared Hit Blocks": 1400, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [] + } + ] + } + ] + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.025, + "Triggers": [], + "Execution Time": 3.363 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4063.0, + "Total Cost": 4068.87, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 3.687, + "Actual Total Time": 4.493, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Gather Merge", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4063.0, + "Total Cost": 6246.97, + "Plan Rows": 18991, + "Plan Width": 79, + "Actual Startup Time": 3.687, + "Actual Total Time": 4.484, + "Actual Rows": 51, + "Actual Loops": 1, + "Workers Planned": 1, + "Workers Launched": 1, + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Sort", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3062.99, + "Total Cost": 3110.47, + "Plan Rows": 18991, + "Plan Width": 79, + "Actual Startup Time": 2.084, + "Actual Total Time": 2.086, + "Actual Rows": 51, + "Actual Loops": 2, + "Sort Key": [ + "created_at", + "id" + ], + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory", + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [ + { + "Worker Number": 0, + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory" + } + ], + "Plans": [ + { + "Node Type": "Seq Scan", + "Parent Relationship": "Outer", + "Parallel Aware": true, + "Async Capable": false, + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.0, + "Total Cost": 2429.41, + "Plan Rows": 18991, + "Plan Width": 79, + "Actual Startup Time": 0.879, + "Actual Total Time": 1.68, + "Actual Rows": 10000, + "Actual Loops": 2, + "Filter": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Filter": 40000, + "Shared Hit Blocks": 1400, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [] + } + ] + } + ] + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.048, + "Triggers": [], + "Execution Time": 4.505 + } + ], + "index_bytes_before_write": 720896, + "insert_rows": 5000, + "insert_commit_seconds": 0.07442411099327728, + "insert_wal_bytes": 1408792 + }, + { + "repeat": 3, + "variant": "chat_only", + "plans": [ + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4057.36, + "Total Cost": 4063.23, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.356, + "Actual Total Time": 3.055, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Gather Merge", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4057.36, + "Total Cost": 6221.89, + "Plan Rows": 18822, + "Plan Width": 79, + "Actual Startup Time": 2.355, + "Actual Total Time": 3.052, + "Actual Rows": 51, + "Actual Loops": 1, + "Workers Planned": 1, + "Workers Launched": 1, + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Sort", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3057.35, + "Total Cost": 3104.41, + "Plan Rows": 18822, + "Plan Width": 79, + "Actual Startup Time": 1.726, + "Actual Total Time": 1.727, + "Actual Rows": 26, + "Actual Loops": 2, + "Sort Key": [ + "created_at", + "id" + ], + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory", + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [ + { + "Worker Number": 0, + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory" + } + ], + "Plans": [ + { + "Node Type": "Seq Scan", + "Parent Relationship": "Outer", + "Parallel Aware": true, + "Async Capable": false, + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.0, + "Total Cost": 2429.41, + "Plan Rows": 18822, + "Plan Width": 79, + "Actual Startup Time": 0.709, + "Actual Total Time": 1.354, + "Actual Rows": 10000, + "Actual Loops": 2, + "Filter": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Filter": 40000, + "Shared Hit Blocks": 1400, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [] + } + ] + } + ] + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.018, + "Triggers": [], + "Execution Time": 3.065 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4057.36, + "Total Cost": 4063.23, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.45, + "Actual Total Time": 3.16, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Gather Merge", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4057.36, + "Total Cost": 6221.89, + "Plan Rows": 18822, + "Plan Width": 79, + "Actual Startup Time": 2.45, + "Actual Total Time": 3.158, + "Actual Rows": 51, + "Actual Loops": 1, + "Workers Planned": 1, + "Workers Launched": 1, + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Sort", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3057.35, + "Total Cost": 3104.41, + "Plan Rows": 18822, + "Plan Width": 79, + "Actual Startup Time": 1.826, + "Actual Total Time": 1.827, + "Actual Rows": 26, + "Actual Loops": 2, + "Sort Key": [ + "created_at", + "id" + ], + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory", + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [ + { + "Worker Number": 0, + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory" + } + ], + "Plans": [ + { + "Node Type": "Seq Scan", + "Parent Relationship": "Outer", + "Parallel Aware": true, + "Async Capable": false, + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.0, + "Total Cost": 2429.41, + "Plan Rows": 18822, + "Plan Width": 79, + "Actual Startup Time": 0.729, + "Actual Total Time": 1.441, + "Actual Rows": 10000, + "Actual Loops": 2, + "Filter": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Filter": 40000, + "Shared Hit Blocks": 1400, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [] + } + ] + } + ] + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.018, + "Triggers": [], + "Execution Time": 3.171 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4057.36, + "Total Cost": 4063.23, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.514, + "Actual Total Time": 3.394, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Gather Merge", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4057.36, + "Total Cost": 6221.89, + "Plan Rows": 18822, + "Plan Width": 79, + "Actual Startup Time": 2.514, + "Actual Total Time": 3.392, + "Actual Rows": 51, + "Actual Loops": 1, + "Workers Planned": 1, + "Workers Launched": 1, + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Sort", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3057.35, + "Total Cost": 3104.41, + "Plan Rows": 18822, + "Plan Width": 79, + "Actual Startup Time": 1.889, + "Actual Total Time": 1.889, + "Actual Rows": 26, + "Actual Loops": 2, + "Sort Key": [ + "created_at", + "id" + ], + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory", + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [ + { + "Worker Number": 0, + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory" + } + ], + "Plans": [ + { + "Node Type": "Seq Scan", + "Parent Relationship": "Outer", + "Parallel Aware": true, + "Async Capable": false, + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.0, + "Total Cost": 2429.41, + "Plan Rows": 18822, + "Plan Width": 79, + "Actual Startup Time": 0.815, + "Actual Total Time": 1.522, + "Actual Rows": 10000, + "Actual Loops": 2, + "Filter": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Filter": 40000, + "Shared Hit Blocks": 1400, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [] + } + ] + } + ] + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.017, + "Triggers": [], + "Execution Time": 3.408 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4057.36, + "Total Cost": 4063.23, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.797, + "Actual Total Time": 3.801, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Gather Merge", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4057.36, + "Total Cost": 6221.89, + "Plan Rows": 18822, + "Plan Width": 79, + "Actual Startup Time": 2.797, + "Actual Total Time": 3.798, + "Actual Rows": 51, + "Actual Loops": 1, + "Workers Planned": 1, + "Workers Launched": 1, + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Sort", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3057.35, + "Total Cost": 3104.41, + "Plan Rows": 18822, + "Plan Width": 79, + "Actual Startup Time": 1.975, + "Actual Total Time": 1.976, + "Actual Rows": 51, + "Actual Loops": 2, + "Sort Key": [ + "created_at", + "id" + ], + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory", + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [ + { + "Worker Number": 0, + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory" + } + ], + "Plans": [ + { + "Node Type": "Seq Scan", + "Parent Relationship": "Outer", + "Parallel Aware": true, + "Async Capable": false, + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.0, + "Total Cost": 2429.41, + "Plan Rows": 18822, + "Plan Width": 79, + "Actual Startup Time": 0.809, + "Actual Total Time": 1.564, + "Actual Rows": 10000, + "Actual Loops": 2, + "Filter": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Filter": 40000, + "Shared Hit Blocks": 1400, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [] + } + ] + } + ] + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.035, + "Triggers": [], + "Execution Time": 3.817 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4057.36, + "Total Cost": 4063.23, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.918, + "Actual Total Time": 3.792, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Gather Merge", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4057.36, + "Total Cost": 6221.89, + "Plan Rows": 18822, + "Plan Width": 79, + "Actual Startup Time": 2.917, + "Actual Total Time": 3.789, + "Actual Rows": 51, + "Actual Loops": 1, + "Workers Planned": 1, + "Workers Launched": 1, + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Sort", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3057.35, + "Total Cost": 3104.41, + "Plan Rows": 18822, + "Plan Width": 79, + "Actual Startup Time": 2.036, + "Actual Total Time": 2.037, + "Actual Rows": 51, + "Actual Loops": 2, + "Sort Key": [ + "created_at", + "id" + ], + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory", + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [ + { + "Worker Number": 0, + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory" + } + ], + "Plans": [ + { + "Node Type": "Seq Scan", + "Parent Relationship": "Outer", + "Parallel Aware": true, + "Async Capable": false, + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.0, + "Total Cost": 2429.41, + "Plan Rows": 18822, + "Plan Width": 79, + "Actual Startup Time": 0.878, + "Actual Total Time": 1.649, + "Actual Rows": 10000, + "Actual Loops": 2, + "Filter": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Filter": 40000, + "Shared Hit Blocks": 1400, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [] + } + ] + } + ] + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.048, + "Triggers": [], + "Execution Time": 3.81 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4057.36, + "Total Cost": 4063.23, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 3.077, + "Actual Total Time": 3.924, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Gather Merge", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4057.36, + "Total Cost": 6221.89, + "Plan Rows": 18822, + "Plan Width": 79, + "Actual Startup Time": 3.077, + "Actual Total Time": 3.911, + "Actual Rows": 51, + "Actual Loops": 1, + "Workers Planned": 1, + "Workers Launched": 1, + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Sort", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3057.35, + "Total Cost": 3104.41, + "Plan Rows": 18822, + "Plan Width": 79, + "Actual Startup Time": 2.065, + "Actual Total Time": 2.067, + "Actual Rows": 51, + "Actual Loops": 2, + "Sort Key": [ + "created_at", + "id" + ], + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory", + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [ + { + "Worker Number": 0, + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory" + } + ], + "Plans": [ + { + "Node Type": "Seq Scan", + "Parent Relationship": "Outer", + "Parallel Aware": true, + "Async Capable": false, + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.0, + "Total Cost": 2429.41, + "Plan Rows": 18822, + "Plan Width": 79, + "Actual Startup Time": 0.911, + "Actual Total Time": 1.67, + "Actual Rows": 10000, + "Actual Loops": 2, + "Filter": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Filter": 40000, + "Shared Hit Blocks": 1400, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [] + } + ] + } + ] + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.056, + "Triggers": [], + "Execution Time": 3.946 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4057.36, + "Total Cost": 4063.23, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.967, + "Actual Total Time": 4.023, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Gather Merge", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4057.36, + "Total Cost": 6221.89, + "Plan Rows": 18822, + "Plan Width": 79, + "Actual Startup Time": 2.966, + "Actual Total Time": 4.018, + "Actual Rows": 51, + "Actual Loops": 1, + "Workers Planned": 1, + "Workers Launched": 1, + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Sort", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3057.35, + "Total Cost": 3104.41, + "Plan Rows": 18822, + "Plan Width": 79, + "Actual Startup Time": 1.927, + "Actual Total Time": 1.929, + "Actual Rows": 51, + "Actual Loops": 2, + "Sort Key": [ + "created_at", + "id" + ], + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory", + "Shared Hit Blocks": 1415, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [ + { + "Worker Number": 0, + "Sort Method": "top-N heapsort", + "Sort Space Used": 31, + "Sort Space Type": "Memory" + } + ], + "Plans": [ + { + "Node Type": "Seq Scan", + "Parent Relationship": "Outer", + "Parallel Aware": true, + "Async Capable": false, + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.0, + "Total Cost": 2429.41, + "Plan Rows": 18822, + "Plan Width": 79, + "Actual Startup Time": 0.8, + "Actual Total Time": 1.554, + "Actual Rows": 10000, + "Actual Loops": 2, + "Filter": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Filter": 40000, + "Shared Hit Blocks": 1400, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Workers": [] + } + ] + } + ] + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.056, + "Triggers": [], + "Execution Time": 4.042 + } + ], + "index_bytes_before_write": 720896, + "insert_rows": 5000, + "insert_commit_seconds": 0.06902265996905044, + "insert_wal_bytes": 1408776 + }, + { + "repeat": 3, + "variant": "composite", + "plans": [ + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.42, + "Total Cost": 7.52, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 0.005, + "Actual Total Time": 0.009, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Index Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Scan Direction": "Forward", + "Index Name": "research_history_idx", + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.42, + "Total Cost": 4472.68, + "Plan Rows": 32103, + "Plan Width": 79, + "Actual Startup Time": 0.005, + "Actual Total Time": 0.007, + "Actual Rows": 51, + "Actual Loops": 1, + "Index Cond": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Index Recheck": 0, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.012, + "Triggers": [], + "Execution Time": 0.013 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.42, + "Total Cost": 7.52, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 0.005, + "Actual Total Time": 0.009, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Index Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Scan Direction": "Forward", + "Index Name": "research_history_idx", + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.42, + "Total Cost": 4472.68, + "Plan Rows": 32103, + "Plan Width": 79, + "Actual Startup Time": 0.005, + "Actual Total Time": 0.007, + "Actual Rows": 51, + "Actual Loops": 1, + "Index Cond": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Index Recheck": 0, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.014, + "Triggers": [], + "Execution Time": 0.013 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.42, + "Total Cost": 7.52, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 0.005, + "Actual Total Time": 0.009, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Index Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Scan Direction": "Forward", + "Index Name": "research_history_idx", + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.42, + "Total Cost": 4472.68, + "Plan Rows": 32103, + "Plan Width": 79, + "Actual Startup Time": 0.005, + "Actual Total Time": 0.007, + "Actual Rows": 51, + "Actual Loops": 1, + "Index Cond": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Index Recheck": 0, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.014, + "Triggers": [], + "Execution Time": 0.013 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.42, + "Total Cost": 7.52, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 0.007, + "Actual Total Time": 0.011, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Index Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Scan Direction": "Forward", + "Index Name": "research_history_idx", + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.42, + "Total Cost": 4472.68, + "Plan Rows": 32103, + "Plan Width": 79, + "Actual Startup Time": 0.007, + "Actual Total Time": 0.009, + "Actual Rows": 51, + "Actual Loops": 1, + "Index Cond": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Index Recheck": 0, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.014, + "Triggers": [], + "Execution Time": 0.015 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.42, + "Total Cost": 7.52, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 0.005, + "Actual Total Time": 0.009, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Index Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Scan Direction": "Forward", + "Index Name": "research_history_idx", + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.42, + "Total Cost": 4472.68, + "Plan Rows": 32103, + "Plan Width": 79, + "Actual Startup Time": 0.005, + "Actual Total Time": 0.007, + "Actual Rows": 51, + "Actual Loops": 1, + "Index Cond": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Index Recheck": 0, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.013, + "Triggers": [], + "Execution Time": 0.013 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.42, + "Total Cost": 7.52, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 0.005, + "Actual Total Time": 0.009, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Index Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Scan Direction": "Forward", + "Index Name": "research_history_idx", + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.42, + "Total Cost": 4472.68, + "Plan Rows": 32103, + "Plan Width": 79, + "Actual Startup Time": 0.005, + "Actual Total Time": 0.007, + "Actual Rows": 51, + "Actual Loops": 1, + "Index Cond": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Index Recheck": 0, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.013, + "Triggers": [], + "Execution Time": 0.013 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.42, + "Total Cost": 7.52, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 0.005, + "Actual Total Time": 0.009, + "Actual Rows": 51, + "Actual Loops": 1, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0, + "Plans": [ + { + "Node Type": "Index Scan", + "Parent Relationship": "Outer", + "Parallel Aware": false, + "Async Capable": false, + "Scan Direction": "Forward", + "Index Name": "research_history_idx", + "Relation Name": "messages", + "Alias": "messages", + "Startup Cost": 0.42, + "Total Cost": 4472.68, + "Plan Rows": 32103, + "Plan Width": 79, + "Actual Startup Time": 0.005, + "Actual Total Time": 0.007, + "Actual Rows": 51, + "Actual Loops": 1, + "Index Cond": "((chat_id = '060a8703-6b43-c8ec-2d06-19c37cea7cc6'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.060001+00'::timestamp with time zone, '0fab29a1-8114-0c41-9ba5-e76265126fad'::uuid)))", + "Rows Removed by Index Recheck": 0, + "Shared Hit Blocks": 4, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + } + ] + }, + "Planning": { + "Shared Hit Blocks": 0, + "Shared Read Blocks": 0, + "Shared Dirtied Blocks": 0, + "Shared Written Blocks": 0, + "Local Hit Blocks": 0, + "Local Read Blocks": 0, + "Local Dirtied Blocks": 0, + "Local Written Blocks": 0, + "Temp Read Blocks": 0, + "Temp Written Blocks": 0 + }, + "Planning Time": 0.013, + "Triggers": [], + "Execution Time": 0.014 + } + ], + "index_bytes_before_write": 5914624, + "insert_rows": 5000, + "insert_commit_seconds": 0.03764251997927204, + "insert_wal_bytes": 1776160 + } + ], + "source": { + "counts": { + "users": 1, + "chats": 10, + "members": 10, + "messages": 100000, + "sessions": 0 + }, + "selected_messages": [ + { + "id": "0001c838-5e9c-14fa-e2db-7c365f0ae786", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 43725", + "created_at": "2026-01-01T00:00:00.043725Z" + }, + { + "id": "0001ea52-19f7-e431-413f-0c7139722585", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 74222", + "created_at": "2026-01-01T00:00:00.074222Z" + }, + { + "id": "0002690d-1e03-106c-bbf1-a5635d6866a2", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 45096", + "created_at": "2026-01-01T00:00:00.045096Z" + }, + { + "id": "000382ad-035f-a00d-2626-5071a98ea252", + "chat_id": "4ee2f816-af67-7a81-db08-55449a8a8b1d", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 96416", + "created_at": "2026-01-01T00:00:00.096416Z" + }, + { + "id": "0003f0ad-267d-0989-230b-9afad60d8ee1", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 62083", + "created_at": "2026-01-01T00:00:00.062083Z" + }, + { + "id": "000431a5-0a5e-5dbc-66fe-12db7c90ee98", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 51664", + "created_at": "2026-01-01T00:00:00.051664Z" + }, + { + "id": "000558ac-913e-8af5-9b02-6f43f24c5262", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 60983", + "created_at": "2026-01-01T00:00:00.060983Z" + }, + { + "id": "00059db6-e524-2a26-f1ab-1d8b36afe630", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 74554", + "created_at": "2026-01-01T00:00:00.074554Z" + }, + { + "id": "00068ff1-993e-b7d9-0f59-b398c30d5030", + "chat_id": "74759bde-90bd-1299-910a-c12fb97f240c", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 85967", + "created_at": "2026-01-01T00:00:00.085967Z" + }, + { + "id": "00079ee2-eddc-0b99-6e0a-2f375b9a1bdb", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 58302", + "created_at": "2026-01-01T00:00:00.058302Z" + }, + { + "id": "0008ff04-8527-3c76-2d9f-e3b3ef0c20e2", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 23016", + "created_at": "2026-01-01T00:00:00.023016Z" + }, + { + "id": "000b0253-f22c-5726-67f5-ae519b1d26dd", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 50802", + "created_at": "2026-01-01T00:00:00.050802Z" + }, + { + "id": "000b94c5-153c-f40a-4874-4f6c78ed7fa9", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 7605", + "created_at": "2026-01-01T00:00:00.007605Z" + }, + { + "id": "000edd5d-a77f-c43e-c7a5-ebb5f9bc3905", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 45088", + "created_at": "2026-01-01T00:00:00.045088Z" + }, + { + "id": "000f3463-de32-9201-cd60-970b5136d545", + "chat_id": "74759bde-90bd-1299-910a-c12fb97f240c", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 82888", + "created_at": "2026-01-01T00:00:00.082888Z" + }, + { + "id": "000f4812-9b9c-bfdd-7196-c1ef4137fb21", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 9508", + "created_at": "2026-01-01T00:00:00.009508Z" + }, + { + "id": "0010430a-d643-d35c-094c-9ee2c45ecc6c", + "chat_id": "74759bde-90bd-1299-910a-c12fb97f240c", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 92891", + "created_at": "2026-01-01T00:00:00.092891Z" + }, + { + "id": "0010f665-722c-c8aa-4944-b145d4b5e62a", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 64562", + "created_at": "2026-01-01T00:00:00.064562Z" + }, + { + "id": "0010fd72-2923-a69b-774f-41af302572c5", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 15470", + "created_at": "2026-01-01T00:00:00.015470Z" + }, + { + "id": "00111c28-69ff-b0d7-6e48-c882d71b1918", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 46574", + "created_at": "2026-01-01T00:00:00.046574Z" + } + ], + "all_messages_md5": "a6ff16d742640cf27df36d74f39a07bd" + } + }, + "backup": { + "seconds": 0.2481626250082627, + "bytes": 3003381, + "sha256": "4bd481dc536a5f7547c5af62409d682e373156e001575a460bc2fec48d1df00d" + }, + "restore": { + "seconds": 0.4013088339706883 + }, + "verification": { + "equal": true, + "restored": { + "counts": { + "users": 1, + "chats": 10, + "members": 10, + "messages": 100000, + "sessions": 0 + }, + "selected_messages": [ + { + "id": "0001c838-5e9c-14fa-e2db-7c365f0ae786", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 43725", + "created_at": "2026-01-01T00:00:00.043725Z" + }, + { + "id": "0001ea52-19f7-e431-413f-0c7139722585", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 74222", + "created_at": "2026-01-01T00:00:00.074222Z" + }, + { + "id": "0002690d-1e03-106c-bbf1-a5635d6866a2", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 45096", + "created_at": "2026-01-01T00:00:00.045096Z" + }, + { + "id": "000382ad-035f-a00d-2626-5071a98ea252", + "chat_id": "4ee2f816-af67-7a81-db08-55449a8a8b1d", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 96416", + "created_at": "2026-01-01T00:00:00.096416Z" + }, + { + "id": "0003f0ad-267d-0989-230b-9afad60d8ee1", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 62083", + "created_at": "2026-01-01T00:00:00.062083Z" + }, + { + "id": "000431a5-0a5e-5dbc-66fe-12db7c90ee98", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 51664", + "created_at": "2026-01-01T00:00:00.051664Z" + }, + { + "id": "000558ac-913e-8af5-9b02-6f43f24c5262", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 60983", + "created_at": "2026-01-01T00:00:00.060983Z" + }, + { + "id": "00059db6-e524-2a26-f1ab-1d8b36afe630", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 74554", + "created_at": "2026-01-01T00:00:00.074554Z" + }, + { + "id": "00068ff1-993e-b7d9-0f59-b398c30d5030", + "chat_id": "74759bde-90bd-1299-910a-c12fb97f240c", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 85967", + "created_at": "2026-01-01T00:00:00.085967Z" + }, + { + "id": "00079ee2-eddc-0b99-6e0a-2f375b9a1bdb", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 58302", + "created_at": "2026-01-01T00:00:00.058302Z" + }, + { + "id": "0008ff04-8527-3c76-2d9f-e3b3ef0c20e2", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 23016", + "created_at": "2026-01-01T00:00:00.023016Z" + }, + { + "id": "000b0253-f22c-5726-67f5-ae519b1d26dd", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 50802", + "created_at": "2026-01-01T00:00:00.050802Z" + }, + { + "id": "000b94c5-153c-f40a-4874-4f6c78ed7fa9", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 7605", + "created_at": "2026-01-01T00:00:00.007605Z" + }, + { + "id": "000edd5d-a77f-c43e-c7a5-ebb5f9bc3905", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 45088", + "created_at": "2026-01-01T00:00:00.045088Z" + }, + { + "id": "000f3463-de32-9201-cd60-970b5136d545", + "chat_id": "74759bde-90bd-1299-910a-c12fb97f240c", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 82888", + "created_at": "2026-01-01T00:00:00.082888Z" + }, + { + "id": "000f4812-9b9c-bfdd-7196-c1ef4137fb21", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 9508", + "created_at": "2026-01-01T00:00:00.009508Z" + }, + { + "id": "0010430a-d643-d35c-094c-9ee2c45ecc6c", + "chat_id": "74759bde-90bd-1299-910a-c12fb97f240c", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 92891", + "created_at": "2026-01-01T00:00:00.092891Z" + }, + { + "id": "0010f665-722c-c8aa-4944-b145d4b5e62a", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 64562", + "created_at": "2026-01-01T00:00:00.064562Z" + }, + { + "id": "0010fd72-2923-a69b-774f-41af302572c5", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 15470", + "created_at": "2026-01-01T00:00:00.015470Z" + }, + { + "id": "00111c28-69ff-b0d7-6e48-c882d71b1918", + "chat_id": "060a8703-6b43-c8ec-2d06-19c37cea7cc6", + "sender_id": "55898af9-a840-7b34-688e-1debc76c4318", + "text": "synthetic message 46574", + "created_at": "2026-01-01T00:00:00.046574Z" + } + ], + "all_messages_md5": "a6ff16d742640cf27df36d74f39a07bd" + } + }, + "summary": { + "chat_only": { + "sql_execution_median_ms": 3.215, + "insert_5000_median_seconds": 0.06902265996905044, + "index_bytes": 720896, + "insert_wal_median_bytes": 1408792 + }, + "composite": { + "sql_execution_median_ms": 0.013, + "insert_5000_median_seconds": 0.03764251997927204, + "index_bytes": 5914624, + "insert_wal_median_bytes": 1776184 + } + }, + "status": "PASS", + "cleanup": { + "removed_only": [ + "research_88185fa70f49", + "restored_88185fa70f49" + ] + } +} diff --git a/evidence/query-study-final.svg b/evidence/query-study-final.svg new file mode 100644 index 00000000..e36d0df7 --- /dev/null +++ b/evidence/query-study-final.svg @@ -0,0 +1,34 @@ + + + +100 000 messages: warm PostgreSQL comparison +SQL median, ms +chat_only + +3.215 +composite + +0.013 +INSERT 5000 + COMMIT, s +chat_only + +0.0690227 +composite + +0.0376425 +Index size, bytes +chat_only + +720896 +composite + +5.91462e+06 +WAL for INSERT 5000, bytes +chat_only + +1.40879e+06 +composite + +1.77618e+06 +3 phases/index; 7 reads/phase; same data and limits. SQL time is not HTTP time. + \ No newline at end of file