From 35764f730c90f9797925313875be0a484c13dcff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B0=D1=81=D0=B8=D0=BB=D1=8C=D0=B5=D0=B2=20=D0=9D?= =?UTF-8?q?=D0=B8=D0=BA=D0=B8=D1=82=D0=B0?= Date: Fri, 30 Oct 2026 17:30:32 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BE=D1=85=D1=80=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B8?= =?UTF-8?q?=20=D0=BE=D1=82=D0=BA=D0=B0=D0=B7=D0=BE=D0=B2,=20=D0=BF=D0=B5?= =?UTF-8?q?=D1=80=D0=B5=D0=B3=D1=80=D1=83=D0=B7=D0=BA=D0=B8=20=D0=B8=20?= =?UTF-8?q?=D0=BE=D1=82=D1=87=D1=91=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/pull_request_template.md | 29 +- .gitignore | 2 + REPORT.md | 162 +- evidence/audit.json | 14 + evidence/build-cache.txt | 108 + evidence/build-final.txt | 135 + evidence/build-initial.txt | 111 + evidence/contract-final.txt | 6 + evidence/contract-initial.txt | 4 + evidence/lifecycle-output.txt | 1 + evidence/lifecycle.json | 63 + evidence/pool-output.txt | 1 + evidence/pool.json | 212 ++ evidence/query-study.json | 4949 ++++++++++++++++++++++++++++++ evidence/query-study.svg | 34 + evidence/smoke-final.txt | 2 + evidence/smoke-initial.txt | 2 + evidence/tests-final.txt | 3 + evidence/tests-initial.txt | 2 + scripts/verify_pool.py | 2 +- 20 files changed, 5806 insertions(+), 36 deletions(-) create mode 100644 evidence/audit.json create mode 100644 evidence/build-cache.txt create mode 100644 evidence/build-final.txt create mode 100644 evidence/build-initial.txt create mode 100644 evidence/contract-final.txt create mode 100644 evidence/contract-initial.txt create mode 100644 evidence/lifecycle-output.txt create mode 100644 evidence/lifecycle.json create mode 100644 evidence/pool-output.txt create mode 100644 evidence/pool.json create mode 100644 evidence/query-study.json create mode 100644 evidence/query-study.svg create mode 100644 evidence/smoke-final.txt create mode 100644 evidence/smoke-initial.txt create mode 100644 evidence/tests-final.txt create mode 100644 evidence/tests-initial.txt diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 8ceefa10..69531773 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,18 +1,19 @@ ## Лабораторная 2 -Автор / группа: TODO -Целевая оценка (3/4/5): TODO -Трек 5, если заявлен: TODO +Васильев Никита, БВТ2301. Целевая оценка5. Трек: План запроса и восстановление. -Что реализовано и что перенесено: TODO -Команды запуска из чистого clone: TODO -Результаты проверок и ссылка на REPORT.md: TODO -Ограничения / известные ошибки: TODO -Источники и использование ИИ: TODO +Реализованы обязательный API и все пункты уровня4; методика выбранного исследования, +реальные результаты и ограничения приведены в [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`. +Подробные проверки отказов и повторение исследования — в отчёте. -- [ ] Весь обязательный минимум текущей и предыдущих работ сохранён с объявленными переходами. -- [ ] Контракт и публичные тесты не ослаблены. -- [ ] make check и make test выполнены; приложен реальный вывод. -- [ ] Сценарии отказов/безопасности своего уровня воспроизведены. -- [ ] Все секреты и приватные ключи находятся вне Git; отчёт не содержит tokens. -- [ ] README задания сохранён, REPORT.md содержит инструкцию именно моего решения. +Исходные contracts и публичные tests сохранены. Secrets, .env и volumes в Git не входят. +Чистый clone проверен отдельно; evidence локальные, удалённый CI пока не запускался. +Публикация в собственный fork и фактический URL МР будут добавлены после получения аккаунта. +Помощь ИИ использована при подготовке и проверке; результаты проверены реальными запусками. + +- [x] Обязательный минимум сохранён с объявленным переходом API. +- [x] Контракт и публичные tests не ослаблены. +- [x] Проверки и ограничения описаны в REPORT.md. +- [x] Исходный README задания сохранён. diff --git a/.gitignore b/.gitignore index b5a71896..94fbfc4c 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,5 @@ coverage/ .vscode/ # Keep small, sanitized evidence summaries in evidence/ under version control. # Inspect git diff --cached: ignore rules are not a secret scanner. +.pytest_cache/ +.ruff_cache/ diff --git a/REPORT.md b/REPORT.md index e42f2b05..d662aabd 100644 --- a/REPORT.md +++ b/REPORT.md @@ -1,37 +1,157 @@ # Отчёт — лабораторная 2 -- Автор, группа: TODO -- Целевая оценка; выбранный трек 5, если нужен: TODO -- Commit/PR: TODO после публикации -- Использованные источники, библиотеки и помощь ИИ: TODO +Автор: **Васильев Никита, БВТ2301**. Целевая оценка: **5**. + +Публикация пока не выполнялась: аккаунт и собственный fork будут предоставлены позднее. +Ветка: `solution/bvt2301-vasilev`. Автор коммитов: `n.a.vasilev@edu.mtuci.ru`. +Исходные README, COURSE, CONTRIBUTING, contracts и публичные tests сохранены. + +Помощь ИИ использована при разборе требований, подготовке реализации, тестов и +материалов защиты. Все заявленные результаты подтверждаются реальными запусками; +чужие реализации, история и результаты измерений не использованы как собственные. + +Выбран трек2: **план запроса и восстановление**. +Исходный проект: https://gitea.privcloud.tech/mtusi2026/mtusi2026lab2 +Название будущего МР: **ЛР 2 — БВТ2301 — Васильев — на 5**. ## Запуск из чистого clone -TODO: версии runtime/образов, prerequisites, команды создания локальных secrets/.env, build, миграций, запуска, ожидания готовности, тестов и остановки. Указать необходимые действия оператора. Не вставлять секреты. Отдельно указать безопасную остановку и команду намеренного удаления учебных данных. +Нужны Docker с Compose, Git, uv и Python3.12. Все зависимости закреплены uv.lock. +Runtime Python3.12.13, FastAPI0.162.0, Pydantic2.14.2, Uvicorn0.54.0; +PostgreSQL17.10-alpine и Valkey8.1.3-alpine. Dockerfile использует digest Python. -## Архитектура и решения +```sh +uv sync --locked --python 3.12 +make up +make check validate PYTHON=.venv/bin/python +make lint test-student +make test +make test-persistence ACTION_SCRIPT=scripts/restart.sh +``` -TODO: схема процессов/хранилищ, источник истины, транзакционные границы, ограничения. Что перенесено из lab1, что изменено в этой работе. Соответствие переменных из .env.example реальной конфигурации. +`make up` вызывает bootstrap, собирает образ с OCI revision, поднимает PostgreSQL +и Valkey, выполняет миграции отдельным сервисом, ждёт healthy API. +API: http://127.0.0.1:8082. Обычный Compose не публикует порты PostgreSQL/Valkey. + +Полная проверка короткого TTL и реальных отказов: + +```sh +VCS_REF=$(git rev-parse HEAD) docker compose -f compose.yaml -f compose.test.yaml up -d --build --wait +python3 scripts/verify_lifecycle.py --output evidence/lifecycle-repeat.json +python3 scripts/verify_pool.py --output evidence/pool-repeat.json +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. Эксперименты отказов запускать +последовательно. Каждому повтору нужен новый evidence-файл. + +Остановка с сохранением данных: `docker compose -f compose.yaml -f compose.test.yaml down`. +Намеренное удаление **только данных этой учебной ЛР2**: та же команда с `--volumes`; +она необратимо удаляет пользователей, сообщения и сессии. Обычная остановка volumes +не удаляет. Не используйте глобальную очистку Docker. + +### Настройки и секреты + +`scripts/bootstrap.py` создаёт secrets один раз и сохраняет существующие значения. +`.env.example` исходный, переменные сопоставлены так: `APP_HOST/APP_PORT` читаются +сервером; `APP_ENV` зарезервирован; `SESSION_TTL_SECONDS` — срок сессии; +`DATABASE_URL_FILE` и `CACHE_URL_FILE` — файлы URL подключений; `SESSION_STORE` +в этой реализации фиксирован PostgreSQL. Созданный `.env` содержит только PUBLIC_PORT +и TTL. Для другого порта задайте PUBLIC_PORT в окружении и make test PUBLIC_PORT=... + +Secrets каталог имеет host mode0700. Файлы0644 внутри него нужны для переносимых +file-backed Compose secret mounts non-root API; в API смонтированы только DB/cache URL, +в PostgreSQL только password. Ни значения, ни `.env`, ни volumes не входят в Git, +образ и сдаваемый пакет. При сохранённых volumes нельзя генерировать новый пароль +вместо старого. Valkey не требует пароля в изолированной внутренней сети; пользователь +с доступом к Docker-host считается доверенным. Для удалённого стенда это требует +дополнительного hardening и TLS. + +## Архитектура, схема, транзакции + +Клиент → один API → PostgreSQL; Valkey содержит disposable User-карточки с TTL60s. +Из собственной ЛР1 перенесены маршруты, строгие схемы, ошибки, ACL, cursor и тесты. +In-memory adapter заменён на `src/messenger/postgres.py`; добавлены password и сессии. +Оригинальные contracts/tests ЛР2 сохранены. Проект не зависит от соседней lab1. + +Схема и границы были описаны до SQL: [SCHEMA.md](SCHEMA.md). +Миграция: [001_initial.sql](migrations/001_initial.sql). PK/FK/UNIQUE защищают +users/chats/members/messages/sessions. Составной FK сообщения требует реального +участника чата. Порядок member_ids сохраняется через position. Создание чата и +всех membership — одна транзакция; неизвестный участник откатывает всё. +Миграции выполняются под advisory lock, сохраняют checksum и при изменении +применённого файла завершаются ошибкой. Повторный запуск идемпотентен. + +Все значения SQL параметризованы. Пул1..8 соединений, очередь≤32, ожидание2s, +connect2s, statement2.5s, lock1.5s; исчерпание и недоступность дают503. +История использует `(chat_id,created_at,id)` и keyset, без OFFSET. +Чтения autocommit, составные записи в явной транзакции. + +Пароли12..128 Unicode code points, без усечения, Argon2id time_cost2, +memory_cost65536KiB, parallelism1, максимум2 KDF одновременно. Basic разбирается +как UTF-8 по первому двоеточию, только при создании сессии; тело входа игнорируется. +Opaque token —32 случайных байта; PostgreSQL хранит SHA-256 token и абсолютный expiry. +Каждый защищённый запрос сначала читает сессию из PostgreSQL, затем карточку из +Valkey или PostgreSQL. Logout удаляет сессию из источника истины. Кэш не может +воскресить её после logout/expiry и не разрешает авторизацию при отказе PostgreSQL. +Карточки User неизменяемы в обязательном API; поэтому не требуется инвалидация, +TTL/eviction/flush/restart безопасны. История не кэшируется и не бывает stale. ## Доказательства критериев -| Критерий README | Команда/сценарий | Наблюдаемый результат | Файл доказательства | -| --- | --- | --- | --- | -| Публичный smoke | make test | TODO | TODO | -| Остальные пункты уровня 3 | TODO | TODO | TODO | -| Все пункты уровня 4, если заявлен | TODO | TODO | TODO | -| Выбранный трек 5, если заявлен | TODO | TODO | TODO | +| Критерий README | Реализация / команда | Наблюдение / evidence | +|---|---|---| +| Сохранённый API с новой идентификацией | make test | [smoke-final.txt](evidence/smoke-final.txt) | +| PG users/chats/members/messages, FK/UNIQUE, атомарность | migrations; test_chat_validation_and_atomicity | [tests-final.txt](evidence/tests-final.txt), [lifecycle.json](evidence/lifecycle.json) | +| Basic/Bearer, password KDF, TTL/logout, X-User-Id игнорируется | test_sessions.py; verify_lifecycle.py | [tests-final.txt](evidence/tests-final.txt), [lifecycle.json](evidence/lifecycle.json) | +| Перезапуск API+PG+cache с тем же токеном | public persistence и actual CID/PID/StartedAt | [lifecycle.json](evidence/lifecycle.json) | +| Повтор миграций, secrets вне Git | verify_lifecycle.py; bootstrap; audit | [lifecycle.json](evidence/lifecycle.json), [audit.json](evidence/audit.json) | +| 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) | +| Трек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) | -TODO: добавить отдельную строку для каждого заявленного критерия. PASS без команды и наблюдения не является доказательством. Проверка инфраструктурного hook требует подтверждения, какие реальные процессы/хранилища перезапущены. +## Исследование и отказы -## Эксперименты и отказы +100000 сообщений, размеры чатов80000/15000/8×625. Сравниваются индекс chat_id +и индекс(chat_id,created_at,id), одинаковый запрос глубокой страницы,5 прогревов, +3фазы на индекс и7 EXPLAIN на фазу. Измерены insertion5000+COMMIT, размер и WAL. +Порядок A/B, B/A, A/B уменьшает дрейф. Все EXPLAIN ANALYZE BUFFERS сохранены. +Числа приведены в [итоге исследования](evidence/query-study-final-summary.md). -TODO: гипотеза, hardware/лимиты, версии, объём данных, профиль нагрузки, concurrency/arrival rate, длительность/прогрев, повторы, успешные RPS, ошибки, p50/p95/p99, CPU/RAM. Сохранить raw summary без tokens и объяснить ограничения измерения. +Реальный pg_dump-Fc восстановлен в новую БД; совпали counts всех5таблиц, +20полных сообщений и checksum всех100000. Исследовательские БД удаляются finally; +рабочая messenger не очищается. При реальном stopPG старый token получает503, +после восстановления снова действует. При stopcache корректный fallback сохраняет +доступ, а анонимный запрос остаётся401. Повторный logout/expiry —401. -| Воздействие | Что ожидаем | Что наблюдали | Время восстановления / потеря данных | -| --- | --- | --- | --- | -| TODO | TODO | TODO | TODO | +SQL latency не равна HTTP latency. WAL общий для кластера; короткие3серии записи +не доказывают небольшое ускорение/замедление. Прогретый локальный restore не включает +доставку копии или замену hardware. Backup отражает снимок; изменения после него +потеряются без PITR. Одна БД, одинhost и отсутствие TLS остаются ограничениями. +Список чатов содержит дополнительные SQL-запросы для member_ids (N+1 до100чатов); +это ограничивает масштабирование, но не корректность. Старые истёкшие сессии могут +оставаться в таблице до операторской уборки, хотя авторизоваться ими нельзя. -## Ограничения и следующие шаги +## Ответы на вопросы защиты -TODO: какие отказы выдерживаются и какие нет; что не реализовано; где учебное упрощение; какое улучшение подтверждено, а какое пока гипотеза. +1. **COMMIT:** транзакция становится видимой целиком. fsync=on, + synchronous_commit=on и full_page_writes=on обеспечивают запись WAL по настройкам + PostgreSQL; volume сохраняет данные при рестарте, но не при потере единственного диска. +2. **Сессии:** digest и expiry находятся в PostgreSQL. Flush/restart Valkey теряет + только кэш публичных карточек; срок сессии не продлевается и logout не отменяется. +3. **Аутентификация/ACL:** Bearer определяет пользователя, membership разрешает + конкретный чат. Даже действующий token постороннего получает404. +4. **Пароль/checksum:** пароль низкоэнтропийный, нужен дорогой salted KDF; + случайный256-битный token имеет другую модель, SHA-256 используется для его поиска + без хранения оригинального секрета. SHA не подходит вместо Argon2id для паролей. + +Подробный конспект: [DEFENSE.md](DEFENSE.md). +Источники: исходный контракт, [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/). diff --git a/evidence/audit.json b/evidence/audit.json new file mode 100644 index 00000000..a0d56845 --- /dev/null +++ b/evidence/audit.json @@ -0,0 +1,14 @@ +{ + "passed": true, + "candidate_files": 73, + "reachable_objects": 85, + "required_source_files": { + "README.md": "unchanged", + "COURSE.md": "unchanged", + "CONTRIBUTING.md": "unchanged", + "contracts": "unchanged", + "tests": "unchanged" + }, + "known_local_password_checked": true, + "scope": "candidate files and all reachable Git objects; no remote publication" +} diff --git a/evidence/build-cache.txt b/evidence/build-cache.txt new file mode 100644 index 00000000..4516e377 --- /dev/null +++ b/evidence/build-cache.txt @@ -0,0 +1,108 @@ + Image mtusi-vasilev:lab2 Building + Image mtusi-vasilev:lab2 Building +#1 [internal] load local bake definitions +#1 reading from stdin 1.23kB done +#1 DONE 0.0s + +#2 [migrate internal] load build definition from Dockerfile +#2 transferring dockerfile: 941B done +#2 DONE 0.0s + +#3 [migrate internal] load metadata for ghcr.io/astral-sh/uv:0.11.7 +#3 DONE 0.0s + +#4 [api internal] load metadata for docker.io/library/python:3.12-slim@sha256:646fb0bca3dd3ea1bcc6feb72c17ed16eed6e10cffc732fcc1478bd3e7f02d7b +#4 DONE 0.0s + +#5 [api internal] load .dockerignore +#5 transferring context: 109B done +#5 DONE 0.0s + +#6 [api internal] load build context +#6 transferring context: 11.64kB done +#6 DONE 0.0s + +#7 [migrate build 1/5] FROM docker.io/library/python:3.12-slim@sha256:646fb0bca3dd3ea1bcc6feb72c17ed16eed6e10cffc732fcc1478bd3e7f02d7b +#7 resolve docker.io/library/python:3.12-slim@sha256:646fb0bca3dd3ea1bcc6feb72c17ed16eed6e10cffc732fcc1478bd3e7f02d7b done +#7 DONE 0.0s + +#8 [api] FROM ghcr.io/astral-sh/uv:0.11.7@sha256:240fb85ab0f263ef12f492d8476aa3a2e4e1e333f7d67fbdd923d00a506a516a +#8 resolve ghcr.io/astral-sh/uv:0.11.7@sha256:240fb85ab0f263ef12f492d8476aa3a2e4e1e333f7d67fbdd923d00a506a516a done +#8 DONE 0.0s + +#9 [migrate build 3/5] WORKDIR /app +#9 CACHED + +#10 [migrate build 5/5] RUN uv sync --locked --no-dev --no-install-project --python /usr/local/bin/python +#10 CACHED + +#11 [migrate build 2/5] COPY --from=ghcr.io/astral-sh/uv:0.11.7 /uv /usr/local/bin/uv +#11 CACHED + +#12 [migrate stage-1 2/5] WORKDIR /app +#12 CACHED + +#13 [migrate build 4/5] COPY pyproject.toml uv.lock ./ +#13 CACHED + +#14 [api stage-1 3/5] COPY --from=build /app/.venv /app/.venv +#14 CACHED + +#15 [api stage-1 4/5] COPY src ./src +#15 DONE 0.0s + +#16 [migrate stage-1 5/5] COPY migrations ./migrations +#16 DONE 0.0s + +#17 [api] exporting to image +#17 exporting layers 0.0s done +#17 exporting manifest sha256:42d0b1c18c4aa8b6a295c492ead287ece57a3187acd7db461d8e848d6330aa25 done +#17 exporting config sha256:8449b4652509011c64cb2779c5708c8eb31137f461238e926a636739d5706e1a done +#17 exporting attestation manifest sha256:603b58c37312ba725c194aba4b804c8774df018263c58a610a3fe87441801c93 +#17 exporting attestation manifest sha256:603b58c37312ba725c194aba4b804c8774df018263c58a610a3fe87441801c93 0.0s done +#17 exporting manifest list sha256:2ea0407e09abffcf5f1e1905a395fcea97b988085675ab77e805d83758db43cc done +#17 naming to docker.io/library/mtusi-vasilev:lab2 done +#17 unpacking to docker.io/library/mtusi-vasilev:lab2 0.0s done +#17 DONE 0.1s + +#18 [migrate] exporting to image +#18 exporting layers 0.0s done +#18 exporting manifest sha256:f93fcbfab9362ac536c54359b4d63fa2b9f1b2c6bbd020f03bbc60b4e71606ba done +#18 exporting config sha256:801010193b0453f24d48c97a39d21f5b3f5b104568d4ec2c59c7e3209040654c done +#18 exporting attestation manifest sha256:9000fcdcf7fdb3d2f6461b3e7b9fc26ccec4c23915ea2cd80df4fc9492c973fc 0.0s done +#18 exporting manifest list sha256:1940fd33577ea36bd5f65c20e9b7ba73f83f347d5bd0565af0e5b5629c8af1b7 done +#18 naming to docker.io/library/mtusi-vasilev:lab2 done +#18 unpacking to docker.io/library/mtusi-vasilev:lab2 done +#18 DONE 0.1s + +#19 [api] resolving provenance for metadata file +#19 DONE 0.0s + +#20 [migrate] resolving provenance for metadata file +#20 DONE 0.0s + Image mtusi-vasilev:lab2 Built + Image mtusi-vasilev:lab2 Built + Container mtusi-vasilev-lab2-postgres-1 Running + Container mtusi-vasilev-lab2-cache-1 Running + Container mtusi-vasilev-lab2-migrate-1 Recreate + Container mtusi-vasilev-lab2-migrate-1 Recreated + Container mtusi-vasilev-lab2-api-1 Recreate + Container mtusi-vasilev-lab2-api-1 Recreated + Container mtusi-vasilev-lab2-postgres-1 Waiting + Container mtusi-vasilev-lab2-postgres-1 Healthy + Container mtusi-vasilev-lab2-migrate-1 Starting + Container mtusi-vasilev-lab2-migrate-1 Started + Container mtusi-vasilev-lab2-migrate-1 Waiting + Container mtusi-vasilev-lab2-cache-1 Waiting + Container mtusi-vasilev-lab2-migrate-1 Exited + Container mtusi-vasilev-lab2-cache-1 Healthy + Container mtusi-vasilev-lab2-api-1 Starting + Container mtusi-vasilev-lab2-api-1 Started + Container mtusi-vasilev-lab2-api-1 Waiting + Container mtusi-vasilev-lab2-postgres-1 Waiting + Container mtusi-vasilev-lab2-cache-1 Waiting + Container mtusi-vasilev-lab2-migrate-1 Waiting + Container mtusi-vasilev-lab2-cache-1 Healthy + Container mtusi-vasilev-lab2-postgres-1 Healthy + Container mtusi-vasilev-lab2-migrate-1 Exited + Container mtusi-vasilev-lab2-api-1 Healthy diff --git a/evidence/build-final.txt b/evidence/build-final.txt new file mode 100644 index 00000000..92eb990f --- /dev/null +++ b/evidence/build-final.txt @@ -0,0 +1,135 @@ + Image mtusi-vasilev:lab2 Building + Image mtusi-vasilev:lab2 Building + Image mtusi-vasilev:lab2 Building +#1 [internal] load local bake definitions +#1 reading from stdin 1.91kB done +#1 DONE 0.0s + +#2 [api internal] load build definition from Dockerfile +#2 transferring dockerfile: 941B done +#2 DONE 0.0s + +#3 [api internal] load metadata for docker.io/library/python:3.12-slim@sha256:646fb0bca3dd3ea1bcc6feb72c17ed16eed6e10cffc732fcc1478bd3e7f02d7b +#3 DONE 0.0s + +#4 [api-short internal] load metadata for ghcr.io/astral-sh/uv:0.11.7 +#4 DONE 0.0s + +#5 [api-short internal] load .dockerignore +#5 transferring context: 109B done +#5 DONE 0.0s + +#6 [api internal] load build context +#6 transferring context: 9.70kB done +#6 DONE 0.0s + +#7 [api-short build 1/5] FROM docker.io/library/python:3.12-slim@sha256:646fb0bca3dd3ea1bcc6feb72c17ed16eed6e10cffc732fcc1478bd3e7f02d7b +#7 resolve docker.io/library/python:3.12-slim@sha256:646fb0bca3dd3ea1bcc6feb72c17ed16eed6e10cffc732fcc1478bd3e7f02d7b 0.0s done +#7 DONE 0.0s + +#8 [api-short] FROM ghcr.io/astral-sh/uv:0.11.7@sha256:240fb85ab0f263ef12f492d8476aa3a2e4e1e333f7d67fbdd923d00a506a516a +#8 resolve ghcr.io/astral-sh/uv:0.11.7@sha256:240fb85ab0f263ef12f492d8476aa3a2e4e1e333f7d67fbdd923d00a506a516a 0.0s done +#8 DONE 0.0s + +#9 [api stage-1 2/5] WORKDIR /app +#9 CACHED + +#10 [api build 5/5] RUN uv sync --locked --no-dev --no-install-project --python /usr/local/bin/python +#10 CACHED + +#11 [api build 4/5] COPY pyproject.toml uv.lock ./ +#11 CACHED + +#12 [api build 2/5] COPY --from=ghcr.io/astral-sh/uv:0.11.7 /uv /usr/local/bin/uv +#12 CACHED + +#13 [api build 3/5] WORKDIR /app +#13 CACHED + +#14 [api stage-1 3/5] COPY --from=build /app/.venv /app/.venv +#14 CACHED + +#15 [api-short stage-1 4/5] COPY src ./src +#15 DONE 0.0s + +#16 [migrate stage-1 5/5] COPY migrations ./migrations +#16 DONE 0.0s + +#17 [api] exporting to image +#17 exporting layers 0.1s done +#17 exporting manifest sha256:432f1d88a72a81ebe646da23f3af7eb1eb0ca2938d88f24eaae54042ede38952 +#17 exporting manifest sha256:432f1d88a72a81ebe646da23f3af7eb1eb0ca2938d88f24eaae54042ede38952 done +#17 exporting config sha256:1b5cc3ea17af385ea711e8686c39c109a0284e6263a6852a8d94db000b3970d4 done +#17 exporting attestation manifest sha256:87135ff983f505b882a8aefcdc2acf64f7e72d35b7c4604f7066cef6893ff64f 0.0s done +#17 exporting manifest list sha256:f6e168c1f546b74ac5180bd3aa195e8f4cf5f002c9ae366d16bf7f574c6a09eb 0.0s done +#17 naming to docker.io/library/mtusi-vasilev:lab2 done +#17 unpacking to docker.io/library/mtusi-vasilev:lab2 0.0s done +#17 DONE 0.1s + +#18 [migrate] exporting to image +#18 exporting layers 0.1s done +#18 exporting manifest sha256:391536dc94736476a626531cce9d1fd30471f5daa44139f932596d818182cb6e done +#18 exporting config sha256:8e63b319ea923b635b77feba2f00aeff8fc6b8d35579d2d7b3ac9c1135e0c3c8 done +#18 exporting attestation manifest sha256:7c69a3e54c93e797e961190b37e5f3993adad21d31b3db18a599d0c290344cad 0.0s done +#18 exporting manifest list sha256:49dd8cf9ad65fe8ab8934a5a95987674643c3cc9aa9805cabf12e77662bbc291 done +#18 naming to docker.io/library/mtusi-vasilev:lab2 done +#18 unpacking to docker.io/library/mtusi-vasilev:lab2 0.0s done +#18 DONE 0.1s + +#19 [api-short] exporting to image +#19 exporting layers 0.1s done +#19 exporting manifest sha256:45021bba21b93e50c897e3d4812790e0b6b674d0f5bd3f423b0847124262fb52 0.0s done +#19 exporting config sha256:bbd200e3f66dd1035503f37a73ffd1bb10f73619e0447a512ea6085891f5f496 done +#19 exporting attestation manifest sha256:772c450f4673d5d7dc6f4e8c55c92d22c444ae88a3d36c4322a835a142a0ded7 0.0s done +#19 exporting manifest list sha256:068b48dec587d6fa1758022fe42da6a2cfb95bb68e56303ef23d0115b0284598 done +#19 naming to docker.io/library/mtusi-vasilev:lab2 done +#19 unpacking to docker.io/library/mtusi-vasilev:lab2 0.0s done +#19 DONE 0.1s + +#20 [migrate] resolving provenance for metadata file +#20 DONE 0.0s + +#21 [api] resolving provenance for metadata file +#21 DONE 0.0s + +#22 [api-short] resolving provenance for metadata file +#22 DONE 0.0s + Image mtusi-vasilev:lab2 Built + Image mtusi-vasilev:lab2 Built + Image mtusi-vasilev:lab2 Built + Container mtusi-vasilev-lab2-migrate-1 Recreate + Container mtusi-vasilev-lab2-migrate-1 Recreated + Container mtusi-vasilev-lab2-api-short-1 Creating + Container mtusi-vasilev-lab2-api-1 Recreate + Container mtusi-vasilev-lab2-api-short-1 Created + Container mtusi-vasilev-lab2-api-1 Recreated + Container mtusi-vasilev-lab2-postgres-1 Starting + Container mtusi-vasilev-lab2-cache-1 Starting + Container mtusi-vasilev-lab2-cache-1 Started + Container mtusi-vasilev-lab2-postgres-1 Started + Container mtusi-vasilev-lab2-postgres-1 Waiting + Container mtusi-vasilev-lab2-postgres-1 Healthy + Container mtusi-vasilev-lab2-migrate-1 Starting + Container mtusi-vasilev-lab2-migrate-1 Started + Container mtusi-vasilev-lab2-migrate-1 Waiting + Container mtusi-vasilev-lab2-migrate-1 Waiting + Container mtusi-vasilev-lab2-cache-1 Waiting + Container mtusi-vasilev-lab2-cache-1 Waiting + Container mtusi-vasilev-lab2-cache-1 Healthy + Container mtusi-vasilev-lab2-migrate-1 Exited + Container mtusi-vasilev-lab2-migrate-1 Exited + Container mtusi-vasilev-lab2-cache-1 Healthy + Container mtusi-vasilev-lab2-api-short-1 Starting + Container mtusi-vasilev-lab2-api-1 Starting + Container mtusi-vasilev-lab2-api-1 Started + Container mtusi-vasilev-lab2-api-short-1 Started + Container mtusi-vasilev-lab2-cache-1 Waiting + Container mtusi-vasilev-lab2-migrate-1 Waiting + Container mtusi-vasilev-lab2-api-1 Waiting + Container mtusi-vasilev-lab2-postgres-1 Waiting + Container mtusi-vasilev-lab2-api-short-1 Waiting + Container mtusi-vasilev-lab2-postgres-1 Healthy + Container mtusi-vasilev-lab2-migrate-1 Exited + Container mtusi-vasilev-lab2-cache-1 Healthy + Container mtusi-vasilev-lab2-api-1 Healthy + Container mtusi-vasilev-lab2-api-short-1 Healthy diff --git a/evidence/build-initial.txt b/evidence/build-initial.txt new file mode 100644 index 00000000..ec4b29ab --- /dev/null +++ b/evidence/build-initial.txt @@ -0,0 +1,111 @@ + Image mtusi-vasilev:lab2 Building + Image mtusi-vasilev:lab2 Building +#1 [internal] load local bake definitions +#1 reading from stdin 1.23kB done +#1 DONE 0.0s + +#2 [migrate internal] load build definition from Dockerfile +#2 transferring dockerfile: 941B done +#2 DONE 0.0s + +#3 [api internal] load metadata for docker.io/library/python:3.12-slim@sha256:646fb0bca3dd3ea1bcc6feb72c17ed16eed6e10cffc732fcc1478bd3e7f02d7b +#3 DONE 0.0s + +#4 [api internal] load metadata for ghcr.io/astral-sh/uv:0.11.7 +#4 DONE 0.0s + +#5 [api internal] load .dockerignore +#5 transferring context: 109B done +#5 DONE 0.0s + +#6 [migrate internal] load build context +#6 transferring context: 586B done +#6 DONE 0.0s + +#7 [api] FROM ghcr.io/astral-sh/uv:0.11.7@sha256:240fb85ab0f263ef12f492d8476aa3a2e4e1e333f7d67fbdd923d00a506a516a +#7 resolve ghcr.io/astral-sh/uv:0.11.7@sha256:240fb85ab0f263ef12f492d8476aa3a2e4e1e333f7d67fbdd923d00a506a516a done +#7 DONE 0.0s + +#8 [api build 1/5] FROM docker.io/library/python:3.12-slim@sha256:646fb0bca3dd3ea1bcc6feb72c17ed16eed6e10cffc732fcc1478bd3e7f02d7b +#8 resolve docker.io/library/python:3.12-slim@sha256:646fb0bca3dd3ea1bcc6feb72c17ed16eed6e10cffc732fcc1478bd3e7f02d7b done +#8 DONE 0.0s + +#9 [api build 2/5] COPY --from=ghcr.io/astral-sh/uv:0.11.7 /uv /usr/local/bin/uv +#9 CACHED + +#10 [api build 4/5] COPY pyproject.toml uv.lock ./ +#10 CACHED + +#11 [api stage-1 4/5] COPY src ./src +#11 CACHED + +#12 [api stage-1 2/5] WORKDIR /app +#12 CACHED + +#13 [api build 5/5] RUN uv sync --locked --no-dev --no-install-project --python /usr/local/bin/python +#13 CACHED + +#14 [api build 3/5] WORKDIR /app +#14 CACHED + +#15 [api stage-1 3/5] COPY --from=build /app/.venv /app/.venv +#15 CACHED + +#16 [migrate stage-1 5/5] COPY migrations ./migrations +#16 CACHED + +#17 [api] exporting to image +#17 exporting layers done +#17 exporting manifest sha256:a767adf69349b1bb5561480dbf515c392464a1957932c97e1ca1bd0cf159253f done +#17 exporting config sha256:ba01ce5652357b766bc456c242e3101eb21bd40d5531376cbcd32fdbfa79d71a done +#17 exporting attestation manifest sha256:425e718cd419a7742bd0a810cd660eceab2ce3377d2e5877b4a24dc051816515 0.0s done +#17 exporting manifest list sha256:cefafcb7c510133bef6010069951db0afd233005fc01e791ab3fcc59436e717f done +#17 naming to docker.io/library/mtusi-vasilev:lab2 done +#17 unpacking to docker.io/library/mtusi-vasilev:lab2 done +#17 DONE 0.0s + +#18 [migrate] exporting to image +#18 exporting layers done +#18 exporting manifest sha256:5908354cc99a403d6885ba41971b36feea08217e3a10e8d5172939e8a8db8495 done +#18 exporting config sha256:8fbc9f74072452224d88e4ec4aae7d226f608649d38c1125573666ddfe91ebf9 done +#18 exporting attestation manifest sha256:1b82bbbfc074915201d8e616d64f87cc7ffdf060e742637775b19026380df44d 0.0s done +#18 exporting manifest list sha256:1c9527cd7b80ac00a7d5d43ec865ae759ddb11b275802ff0df97b87b74627073 done +#18 naming to docker.io/library/mtusi-vasilev:lab2 done +#18 unpacking to docker.io/library/mtusi-vasilev:lab2 done +#18 DONE 0.0s + +#19 [api] resolving provenance for metadata file +#19 DONE 0.0s + +#20 [migrate] resolving provenance for metadata file +#20 DONE 0.0s + Image mtusi-vasilev:lab2 Built + Image mtusi-vasilev:lab2 Built + Container mtusi-vasilev-lab2-migrate-1 Creating + Container mtusi-vasilev-lab2-cache-1 Recreate + Container mtusi-vasilev-lab2-migrate-1 Created + Container mtusi-vasilev-lab2-cache-1 Recreated + Container mtusi-vasilev-lab2-api-1 Creating + Container mtusi-vasilev-lab2-api-1 Created + Container mtusi-vasilev-lab2-cache-1 Starting + Container mtusi-vasilev-lab2-postgres-1 Starting + Container mtusi-vasilev-lab2-cache-1 Started + Container mtusi-vasilev-lab2-postgres-1 Started + Container mtusi-vasilev-lab2-postgres-1 Waiting + Container mtusi-vasilev-lab2-postgres-1 Healthy + Container mtusi-vasilev-lab2-migrate-1 Starting + Container mtusi-vasilev-lab2-migrate-1 Started + Container mtusi-vasilev-lab2-cache-1 Waiting + Container mtusi-vasilev-lab2-migrate-1 Waiting + Container mtusi-vasilev-lab2-cache-1 Healthy + Container mtusi-vasilev-lab2-migrate-1 Exited + Container mtusi-vasilev-lab2-api-1 Starting + Container mtusi-vasilev-lab2-api-1 Started + Container mtusi-vasilev-lab2-api-1 Waiting + Container mtusi-vasilev-lab2-postgres-1 Waiting + Container mtusi-vasilev-lab2-cache-1 Waiting + Container mtusi-vasilev-lab2-migrate-1 Waiting + Container mtusi-vasilev-lab2-migrate-1 Exited + Container mtusi-vasilev-lab2-cache-1 Healthy + Container mtusi-vasilev-lab2-postgres-1 Healthy + Container mtusi-vasilev-lab2-api-1 Healthy diff --git a/evidence/contract-final.txt b/evidence/contract-final.txt new file mode 100644 index 00000000..b79f0160 --- /dev/null +++ b/evidence/contract-final.txt @@ -0,0 +1,6 @@ +.venv/bin/python scripts/check_contract.py +PASS: offline skeleton structure, local refs and Python syntax; application NOT tested. +.venv/bin/python scripts/validate_openapi.py +PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested. +uv run --locked ruff check src student-tests research +All checks passed! diff --git a/evidence/contract-initial.txt b/evidence/contract-initial.txt new file mode 100644 index 00000000..ed9cd475 --- /dev/null +++ b/evidence/contract-initial.txt @@ -0,0 +1,4 @@ +.venv/bin/python scripts/check_contract.py +PASS: offline skeleton structure, local refs and Python syntax; application NOT tested. +.venv/bin/python scripts/validate_openapi.py +PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested. diff --git a/evidence/lifecycle-output.txt b/evidence/lifecycle-output.txt new file mode 100644 index 00000000..c2661c25 --- /dev/null +++ b/evidence/lifecycle-output.txt @@ -0,0 +1 @@ +PASS: real restart, same token, cache/DB faults, rollback, expiry and logout diff --git a/evidence/lifecycle.json b/evidence/lifecycle.json new file mode 100644 index 00000000..2c91b9ce --- /dev/null +++ b/evidence/lifecycle.json @@ -0,0 +1,63 @@ +{ + "date_utc": "2026-10-30T14:29:20.955064+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": "1a09782c5a2e1415b9d658444fc0336bb5eda6ad0660e36cf84659fd2bbb7594", + "pid": 19077, + "started_at": "2026-10-30T14:28:23.635694089Z" + }, + "cache": { + "cid": "12a042ef8a5ab3098d941461b5971c7521ecd7a0838b1f1eb2f2319a8587313b", + "pid": 18807, + "started_at": "2026-10-30T14:28:20.486422322Z" + }, + "postgres": { + "cid": "3e542fd46e4ff3e93f51a47a2de728ef0d5d9146373671ae461aa82e81ed28bb", + "pid": 18806, + "started_at": "2026-10-30T14:28:20.486758282Z" + } + }, + "after": { + "api": { + "cid": "1a09782c5a2e1415b9d658444fc0336bb5eda6ad0660e36cf84659fd2bbb7594", + "pid": 21859, + "started_at": "2026-10-30T14:29:22.238596408Z" + }, + "cache": { + "cid": "12a042ef8a5ab3098d941461b5971c7521ecd7a0838b1f1eb2f2319a8587313b", + "pid": 21728, + "started_at": "2026-10-30T14:29:22.040913407Z" + }, + "postgres": { + "cid": "3e542fd46e4ff3e93f51a47a2de728ef0d5d9146373671ae461aa82e81ed28bb", + "pid": 21673, + "started_at": "2026-10-30T14:29:22.004637237Z" + } + }, + "same_token_and_message_after_restart": true, + "cache_flush_repopulates": true, + "cache_failure": { + "authenticated_status": 200, + "anonymous_status": 401, + "seconds": 0.0427 + }, + "database_failure": { + "cached_actor_status": 503, + "ready_status": 503, + "live_status": 200, + "seconds": 2.0018 + }, + "session_after_database_recovery": true, + "failed_chat_transaction_left_rows": 0, + "migrations_reapplied_twice": true, + "expiry": { + "configured_ttl_seconds": 2, + "observed_after_seconds": 2.3825, + "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-output.txt b/evidence/pool-output.txt new file mode 100644 index 00000000..818573ed --- /dev/null +++ b/evidence/pool-output.txt @@ -0,0 +1 @@ +PASS: real bounded connection pool overload returns 503 diff --git a/evidence/pool.json b/evidence/pool.json new file mode 100644 index 00000000..98293ff0 --- /dev/null +++ b/evidence/pool.json @@ -0,0 +1,212 @@ +{ + "passed": true, + "clients": 50, + "max_pool_size": 8, + "max_waiting": 32, + "admitted": 8, + "rejected_503": 42, + "max_seconds": 2.226985312998295, + "rows": [ + { + "status": 503, + "seconds": 2.0008593890233897 + }, + { + "status": 503, + "seconds": 9.08802030608058e-06 + }, + { + "status": 200, + "seconds": 2.2165114110102877 + }, + { + "status": 200, + "seconds": 2.226985312998295 + }, + { + "status": 503, + "seconds": 1.3715005479753017e-05 + }, + { + "status": 503, + "seconds": 2.0015193020226434 + }, + { + "status": 503, + "seconds": 2.001966067997273 + }, + { + "status": 503, + "seconds": 8.628994692116976e-06 + }, + { + "status": 503, + "seconds": 2.0018118239822797 + }, + { + "status": 503, + "seconds": 3.668013960123062e-06 + }, + { + "status": 503, + "seconds": 8.004019036889076e-06 + }, + { + "status": 503, + "seconds": 2.001962565991562 + }, + { + "status": 503, + "seconds": 2.002134026028216 + }, + { + "status": 503, + "seconds": 2.001673088001553 + }, + { + "status": 503, + "seconds": 2.002291854994837 + }, + { + "status": 503, + "seconds": 2.002486660028808 + }, + { + "status": 503, + "seconds": 2.00323870300781 + }, + { + "status": 503, + "seconds": 2.001060738984961 + }, + { + "status": 503, + "seconds": 2.0012402459979057 + }, + { + "status": 503, + "seconds": 3.959983587265015e-06 + }, + { + "status": 200, + "seconds": 2.2083417040412314 + }, + { + "status": 200, + "seconds": 2.214471307990607 + }, + { + "status": 200, + "seconds": 2.2163876409758814 + }, + { + "status": 503, + "seconds": 2.001500209036749 + }, + { + "status": 503, + "seconds": 2.0021683349623345 + }, + { + "status": 503, + "seconds": 2.0028698940295726 + }, + { + "status": 503, + "seconds": 2.960034180432558e-06 + }, + { + "status": 503, + "seconds": 3.709981683641672e-06 + }, + { + "status": 503, + "seconds": 2.0020870030275546 + }, + { + "status": 503, + "seconds": 2.00253055797657 + }, + { + "status": 503, + "seconds": 2.0026431559817865 + }, + { + "status": 503, + "seconds": 2.0026960149989463 + }, + { + "status": 503, + "seconds": 2.002982742036693 + }, + { + "status": 503, + "seconds": 2.002759379975032 + }, + { + "status": 503, + "seconds": 7.504015229642391e-06 + }, + { + "status": 503, + "seconds": 3.668013960123062e-06 + }, + { + "status": 503, + "seconds": 3.001012373715639e-06 + }, + { + "status": 503, + "seconds": 2.0022876450093463 + }, + { + "status": 503, + "seconds": 3.001012373715639e-06 + }, + { + "status": 503, + "seconds": 2.0025205940473825 + }, + { + "status": 503, + "seconds": 1.2798001989722252e-05 + }, + { + "status": 503, + "seconds": 5.378038622438908e-06 + }, + { + "status": 503, + "seconds": 1.496501499786973e-05 + }, + { + "status": 200, + "seconds": 2.222472182009369 + }, + { + "status": 200, + "seconds": 2.222849245008547 + }, + { + "status": 503, + "seconds": 2.002373645955231 + }, + { + "status": 503, + "seconds": 5.418958608061075e-06 + }, + { + "status": 503, + "seconds": 2.003417416999582 + }, + { + "status": 503, + "seconds": 3.627035766839981e-06 + }, + { + "status": 200, + "seconds": 2.2056722860434093 + } + ], + "date_utc": "2026-10-30T14:29:39.194790+00:00" +} diff --git a/evidence/query-study.json b/evidence/query-study.json new file mode 100644 index 00000000..c4c3e103 --- /dev/null +++ b/evidence/query-study.json @@ -0,0 +1,4949 @@ +{ + "started_utc": "2026-10-30T14:20:04.298330+00:00", + "databases": { + "original": "research_fe54d4a9ba9c", + "restored": "restored_fe54d4a9ba9c" + }, + "command": "uv run --locked python research/run.py --output evidence/query-study.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": "65003b61195361aac238f19c9bff0027ca58e09e", + "source_worktree_dirty": true, + "postgres_container": { + "id": "3e542fd46e4ff3e93f51a47a2de728ef0d5d9146373671ae461aa82e81ed28bb", + "image_id": "sha256:742f40ea20b9ff2ff31db5458d127452988a2164df9e17441e191f3b72252193", + "nano_cpus": 1000000000, + "memory_limit_bytes": 805306368 + }, + "study": { + "seed_seconds": 0.8469094519969076, + "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.1, + "Total Cost": 4000.97, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.433, + "Actual Total Time": 3.206, + "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.1, + "Total Cost": 6172.51, + "Plan Rows": 18934, + "Plan Width": 79, + "Actual Startup Time": 2.433, + "Actual Total Time": 3.203, + "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.09, + "Total Cost": 3042.43, + "Plan Rows": 18934, + "Plan Width": 79, + "Actual Startup Time": 1.76, + "Actual Total Time": 1.76, + "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": 18934, + "Plan Width": 79, + "Actual Startup Time": 0.71, + "Actual Total Time": 1.381, + "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.039, + "Triggers": [], + "Execution Time": 3.218 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3995.1, + "Total Cost": 4000.97, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.489, + "Actual Total Time": 3.258, + "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.1, + "Total Cost": 6172.51, + "Plan Rows": 18934, + "Plan Width": 79, + "Actual Startup Time": 2.489, + "Actual Total Time": 3.248, + "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.09, + "Total Cost": 3042.43, + "Plan Rows": 18934, + "Plan Width": 79, + "Actual Startup Time": 1.827, + "Actual Total Time": 1.828, + "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": 18934, + "Plan Width": 79, + "Actual Startup Time": 0.753, + "Actual Total Time": 1.438, + "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.026, + "Triggers": [], + "Execution Time": 3.268 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3995.1, + "Total Cost": 4000.97, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.613, + "Actual Total Time": 3.385, + "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.1, + "Total Cost": 6172.51, + "Plan Rows": 18934, + "Plan Width": 79, + "Actual Startup Time": 2.613, + "Actual Total Time": 3.376, + "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.09, + "Total Cost": 3042.43, + "Plan Rows": 18934, + "Plan Width": 79, + "Actual Startup Time": 1.952, + "Actual Total Time": 1.953, + "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": 18934, + "Plan Width": 79, + "Actual Startup Time": 0.794, + "Actual Total Time": 1.53, + "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.032, + "Triggers": [], + "Execution Time": 3.405 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3995.1, + "Total Cost": 4000.97, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.786, + "Actual Total Time": 3.647, + "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.1, + "Total Cost": 6172.51, + "Plan Rows": 18934, + "Plan Width": 79, + "Actual Startup Time": 2.785, + "Actual Total Time": 3.644, + "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.09, + "Total Cost": 3042.43, + "Plan Rows": 18934, + "Plan Width": 79, + "Actual Startup Time": 2.131, + "Actual Total Time": 2.132, + "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": 18934, + "Plan Width": 79, + "Actual Startup Time": 0.901, + "Actual Total Time": 1.709, + "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.03, + "Triggers": [], + "Execution Time": 3.658 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3995.1, + "Total Cost": 4000.97, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.666, + "Actual Total Time": 3.421, + "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.1, + "Total Cost": 6172.51, + "Plan Rows": 18934, + "Plan Width": 79, + "Actual Startup Time": 2.666, + "Actual Total Time": 3.418, + "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.09, + "Total Cost": 3042.43, + "Plan Rows": 18934, + "Plan Width": 79, + "Actual Startup Time": 1.952, + "Actual Total Time": 1.953, + "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": 18934, + "Plan Width": 79, + "Actual Startup Time": 0.778, + "Actual Total Time": 1.537, + "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.036, + "Triggers": [], + "Execution Time": 3.431 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3995.1, + "Total Cost": 4000.97, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.643, + "Actual Total Time": 3.394, + "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.1, + "Total Cost": 6172.51, + "Plan Rows": 18934, + "Plan Width": 79, + "Actual Startup Time": 2.642, + "Actual Total Time": 3.39, + "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.09, + "Total Cost": 3042.43, + "Plan Rows": 18934, + "Plan Width": 79, + "Actual Startup Time": 1.931, + "Actual Total Time": 1.933, + "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": 18934, + "Plan Width": 79, + "Actual Startup Time": 0.796, + "Actual Total Time": 1.517, + "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.052, + "Triggers": [], + "Execution Time": 3.406 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 3995.1, + "Total Cost": 4000.97, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.538, + "Actual Total Time": 3.265, + "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.1, + "Total Cost": 6172.51, + "Plan Rows": 18934, + "Plan Width": 79, + "Actual Startup Time": 2.538, + "Actual Total Time": 3.263, + "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.09, + "Total Cost": 3042.43, + "Plan Rows": 18934, + "Plan Width": 79, + "Actual Startup Time": 1.854, + "Actual Total Time": 1.856, + "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": 18934, + "Plan Width": 79, + "Actual Startup Time": 0.787, + "Actual Total Time": 1.467, + "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.033, + "Triggers": [], + "Execution Time": 3.281 + } + ], + "index_bytes_before_write": 720896, + "insert_rows": 5000, + "insert_commit_seconds": 0.06770279299234971, + "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.59, + "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": 4515.44, + "Plan Rows": 32090, + "Plan Width": 79, + "Actual Startup Time": 0.004, + "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.01, + "Triggers": [], + "Execution Time": 0.013 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.42, + "Total Cost": 7.59, + "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": 4515.44, + "Plan Rows": 32090, + "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.59, + "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": 4515.44, + "Plan Rows": 32090, + "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.59, + "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": 4515.44, + "Plan Rows": 32090, + "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.59, + "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": 4515.44, + "Plan Rows": 32090, + "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.59, + "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": 4515.44, + "Plan Rows": 32090, + "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.59, + "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": 4515.44, + "Plan Rows": 32090, + "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.039442461042199284, + "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.55, + "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": 4483.98, + "Plan Rows": 32056, + "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.02, + "Triggers": [], + "Execution Time": 0.015 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.42, + "Total Cost": 7.55, + "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": 4483.98, + "Plan Rows": 32056, + "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.014 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.42, + "Total Cost": 7.55, + "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": 4483.98, + "Plan Rows": 32056, + "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.55, + "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": 4483.98, + "Plan Rows": 32056, + "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.55, + "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": 4483.98, + "Plan Rows": 32056, + "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.55, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 0.004, + "Actual Total Time": 0.013, + "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": 4483.98, + "Plan Rows": 32056, + "Plan Width": 79, + "Actual Startup Time": 0.004, + "Actual Total Time": 0.011, + "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.017 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.42, + "Total Cost": 7.55, + "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": 4483.98, + "Plan Rows": 32056, + "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.03789239499019459, + "insert_wal_bytes": 1776184 + }, + { + "repeat": 2, + "variant": "chat_only", + "plans": [ + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4054.59, + "Total Cost": 4060.46, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.451, + "Actual Total Time": 3.115, + "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": 4054.59, + "Total Cost": 6209.58, + "Plan Rows": 18739, + "Plan Width": 79, + "Actual Startup Time": 2.451, + "Actual Total Time": 3.111, + "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": 3054.58, + "Total Cost": 3101.43, + "Plan Rows": 18739, + "Plan Width": 79, + "Actual Startup Time": 1.817, + "Actual Total Time": 1.817, + "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": 18739, + "Plan Width": 79, + "Actual Startup Time": 0.705, + "Actual Total Time": 1.399, + "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.024, + "Triggers": [], + "Execution Time": 3.131 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4054.59, + "Total Cost": 4060.46, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.412, + "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": 4054.59, + "Total Cost": 6209.58, + "Plan Rows": 18739, + "Plan Width": 79, + "Actual Startup Time": 2.411, + "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": 3054.58, + "Total Cost": 3101.43, + "Plan Rows": 18739, + "Plan Width": 79, + "Actual Startup Time": 1.776, + "Actual Total Time": 1.777, + "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": 18739, + "Plan Width": 79, + "Actual Startup Time": 0.723, + "Actual Total Time": 1.376, + "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.048 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4054.59, + "Total Cost": 4060.46, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 32.558, + "Actual Total Time": 33.51, + "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": 4054.59, + "Total Cost": 6209.58, + "Plan Rows": 18739, + "Plan Width": 79, + "Actual Startup Time": 32.558, + "Actual Total Time": 33.508, + "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": 3054.58, + "Total Cost": 3101.43, + "Plan Rows": 18739, + "Plan Width": 79, + "Actual Startup Time": 17.072, + "Actual Total Time": 17.074, + "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": 18739, + "Plan Width": 79, + "Actual Startup Time": 0.723, + "Actual Total Time": 16.673, + "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.023, + "Triggers": [], + "Execution Time": 33.521 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4054.59, + "Total Cost": 4060.46, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.697, + "Actual Total Time": 3.47, + "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": 4054.59, + "Total Cost": 6209.58, + "Plan Rows": 18739, + "Plan Width": 79, + "Actual Startup Time": 2.696, + "Actual Total Time": 3.467, + "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": 3054.58, + "Total Cost": 3101.43, + "Plan Rows": 18739, + "Plan Width": 79, + "Actual Startup Time": 1.976, + "Actual Total Time": 1.977, + "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": 18739, + "Plan Width": 79, + "Actual Startup Time": 0.83, + "Actual Total Time": 1.579, + "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.038, + "Triggers": [], + "Execution Time": 3.48 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4054.59, + "Total Cost": 4060.46, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.795, + "Actual Total Time": 3.649, + "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": 4054.59, + "Total Cost": 6209.58, + "Plan Rows": 18739, + "Plan Width": 79, + "Actual Startup Time": 2.795, + "Actual Total Time": 3.645, + "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": 3054.58, + "Total Cost": 3101.43, + "Plan Rows": 18739, + "Plan Width": 79, + "Actual Startup Time": 2.043, + "Actual Total Time": 2.044, + "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": 18739, + "Plan Width": 79, + "Actual Startup Time": 0.876, + "Actual Total Time": 1.627, + "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.024, + "Triggers": [], + "Execution Time": 3.662 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4054.59, + "Total Cost": 4060.46, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.625, + "Actual Total Time": 3.296, + "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": 4054.59, + "Total Cost": 6209.58, + "Plan Rows": 18739, + "Plan Width": 79, + "Actual Startup Time": 2.624, + "Actual Total Time": 3.287, + "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": 3054.58, + "Total Cost": 3101.43, + "Plan Rows": 18739, + "Plan Width": 79, + "Actual Startup Time": 1.942, + "Actual Total Time": 1.943, + "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": 18739, + "Plan Width": 79, + "Actual Startup Time": 0.835, + "Actual Total Time": 1.557, + "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.032, + "Triggers": [], + "Execution Time": 3.305 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4054.59, + "Total Cost": 4060.46, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.668, + "Actual Total Time": 3.426, + "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": 4054.59, + "Total Cost": 6209.58, + "Plan Rows": 18739, + "Plan Width": 79, + "Actual Startup Time": 2.668, + "Actual Total Time": 3.423, + "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": 3054.58, + "Total Cost": 3101.43, + "Plan Rows": 18739, + "Plan Width": 79, + "Actual Startup Time": 2.051, + "Actual Total Time": 2.051, + "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": 18739, + "Plan Width": 79, + "Actual Startup Time": 0.889, + "Actual Total Time": 1.656, + "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.02, + "Triggers": [], + "Execution Time": 3.433 + } + ], + "index_bytes_before_write": 720896, + "insert_rows": 5000, + "insert_commit_seconds": 0.049711717991158366, + "insert_wal_bytes": 1408792 + }, + { + "repeat": 3, + "variant": "chat_only", + "plans": [ + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4062.6, + "Total Cost": 4068.47, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 3.915, + "Actual Total Time": 4.938, + "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": 4062.6, + "Total Cost": 6245.19, + "Plan Rows": 18979, + "Plan Width": 79, + "Actual Startup Time": 3.914, + "Actual Total Time": 4.934, + "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.59, + "Total Cost": 3110.04, + "Plan Rows": 18979, + "Plan Width": 79, + "Actual Startup Time": 2.714, + "Actual Total Time": 2.716, + "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": 18979, + "Plan Width": 79, + "Actual Startup Time": 0.881, + "Actual Total Time": 2.301, + "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.043, + "Triggers": [], + "Execution Time": 4.955 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4062.6, + "Total Cost": 4068.47, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 25.316, + "Actual Total Time": 26.35, + "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": 4062.6, + "Total Cost": 6245.19, + "Plan Rows": 18979, + "Plan Width": 79, + "Actual Startup Time": 25.315, + "Actual Total Time": 26.345, + "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.59, + "Total Cost": 3110.04, + "Plan Rows": 18979, + "Plan Width": 79, + "Actual Startup Time": 1.927, + "Actual Total Time": 1.932, + "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": "quicksort", + "Sort Space Used": 25, + "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": 18979, + "Plan Width": 79, + "Actual Startup Time": 0.879, + "Actual Total Time": 1.558, + "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.064, + "Triggers": [], + "Execution Time": 26.367 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4062.6, + "Total Cost": 4068.47, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 3.027, + "Actual Total Time": 3.773, + "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": 4062.6, + "Total Cost": 6245.19, + "Plan Rows": 18979, + "Plan Width": 79, + "Actual Startup Time": 3.027, + "Actual Total Time": 3.769, + "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.59, + "Total Cost": 3110.04, + "Plan Rows": 18979, + "Plan Width": 79, + "Actual Startup Time": 2.284, + "Actual Total Time": 2.286, + "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": 18979, + "Plan Width": 79, + "Actual Startup Time": 1.013, + "Actual Total Time": 1.882, + "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.787 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4062.6, + "Total Cost": 4068.47, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.889, + "Actual Total Time": 3.654, + "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": 4062.6, + "Total Cost": 6245.19, + "Plan Rows": 18979, + "Plan Width": 79, + "Actual Startup Time": 2.888, + "Actual Total Time": 3.651, + "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.59, + "Total Cost": 3110.04, + "Plan Rows": 18979, + "Plan Width": 79, + "Actual Startup Time": 2.092, + "Actual Total Time": 2.097, + "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": 18979, + "Plan Width": 79, + "Actual Startup Time": 0.865, + "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.031, + "Triggers": [], + "Execution Time": 3.671 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4062.6, + "Total Cost": 4068.47, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.692, + "Actual Total Time": 3.625, + "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": 4062.6, + "Total Cost": 6245.19, + "Plan Rows": 18979, + "Plan Width": 79, + "Actual Startup Time": 2.692, + "Actual Total Time": 3.623, + "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.59, + "Total Cost": 3110.04, + "Plan Rows": 18979, + "Plan Width": 79, + "Actual Startup Time": 1.854, + "Actual Total Time": 1.855, + "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": 18979, + "Plan Width": 79, + "Actual Startup Time": 0.743, + "Actual Total Time": 1.482, + "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.039, + "Triggers": [], + "Execution Time": 3.638 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4062.6, + "Total Cost": 4068.47, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.849, + "Actual Total Time": 3.672, + "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": 4062.6, + "Total Cost": 6245.19, + "Plan Rows": 18979, + "Plan Width": 79, + "Actual Startup Time": 2.848, + "Actual Total Time": 3.668, + "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.59, + "Total Cost": 3110.04, + "Plan Rows": 18979, + "Plan Width": 79, + "Actual Startup Time": 2.067, + "Actual Total Time": 2.068, + "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": 18979, + "Plan Width": 79, + "Actual Startup Time": 0.882, + "Actual Total Time": 1.673, + "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.038, + "Triggers": [], + "Execution Time": 3.684 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 4062.6, + "Total Cost": 4068.47, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 2.501, + "Actual Total Time": 3.176, + "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": 4062.6, + "Total Cost": 6245.19, + "Plan Rows": 18979, + "Plan Width": 79, + "Actual Startup Time": 2.501, + "Actual Total Time": 3.174, + "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.59, + "Total Cost": 3110.04, + "Plan Rows": 18979, + "Plan Width": 79, + "Actual Startup Time": 1.784, + "Actual Total Time": 1.785, + "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": 18979, + "Plan Width": 79, + "Actual Startup Time": 0.724, + "Actual Total Time": 1.412, + "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.186 + } + ], + "index_bytes_before_write": 720896, + "insert_rows": 5000, + "insert_commit_seconds": 0.038499657006468624, + "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.59, + "Plan Rows": 51, + "Plan Width": 79, + "Actual Startup Time": 0.006, + "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": 4469.25, + "Plan Rows": 31769, + "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.017, + "Triggers": [], + "Execution Time": 0.014 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.42, + "Total Cost": 7.59, + "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": 4469.25, + "Plan Rows": 31769, + "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.014 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.42, + "Total Cost": 7.59, + "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": 4469.25, + "Plan Rows": 31769, + "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.014 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.42, + "Total Cost": 7.59, + "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": 4469.25, + "Plan Rows": 31769, + "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.014 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.42, + "Total Cost": 7.59, + "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": 4469.25, + "Plan Rows": 31769, + "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.59, + "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": 4469.25, + "Plan Rows": 31769, + "Plan Width": 79, + "Actual Startup Time": 0.005, + "Actual Total Time": 0.008, + "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.018, + "Triggers": [], + "Execution Time": 0.015 + }, + { + "Plan": { + "Node Type": "Limit", + "Parallel Aware": false, + "Async Capable": false, + "Startup Cost": 0.42, + "Total Cost": 7.59, + "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": 4469.25, + "Plan Rows": 31769, + "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 + } + ], + "index_bytes_before_write": 5914624, + "insert_rows": 5000, + "insert_commit_seconds": 0.044263787975069135, + "insert_wal_bytes": 1776184 + } + ], + "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.26255995797691867, + "bytes": 3003381, + "sha256": "65a19c5800192724c7e342a18a0b73d8ae78f243d1ab6c9dd40c17e32fc62f63" + }, + "restore": { + "seconds": 0.36899566696956754 + }, + "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.433, + "insert_5000_median_seconds": 0.049711717991158366, + "index_bytes": 720896, + "insert_wal_median_bytes": 1408792 + }, + "composite": { + "sql_execution_median_ms": 0.013, + "insert_5000_median_seconds": 0.039442461042199284, + "index_bytes": 5914624, + "insert_wal_median_bytes": 1776184 + } + }, + "status": "PASS", + "cleanup": { + "removed_only": [ + "research_fe54d4a9ba9c", + "restored_fe54d4a9ba9c" + ] + } +} diff --git a/evidence/query-study.svg b/evidence/query-study.svg new file mode 100644 index 00000000..9e287b11 --- /dev/null +++ b/evidence/query-study.svg @@ -0,0 +1,34 @@ + + + +100 000 messages: warm PostgreSQL comparison +SQL median, ms +chat_only + +3.433 +composite + +0.013 +INSERT 5000 + COMMIT, s +chat_only + +0.0497117 +composite + +0.0394425 +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 diff --git a/evidence/smoke-final.txt b/evidence/smoke-final.txt new file mode 100644 index 00000000..b8dc75f0 --- /dev/null +++ b/evidence/smoke-final.txt @@ -0,0 +1,2 @@ +python3 tests/smoke.py --base-url "http://127.0.0.1:8082" +PASS: lab2 public API scenario; infrastructure and grading evidence remain separate. diff --git a/evidence/smoke-initial.txt b/evidence/smoke-initial.txt new file mode 100644 index 00000000..b8dc75f0 --- /dev/null +++ b/evidence/smoke-initial.txt @@ -0,0 +1,2 @@ +python3 tests/smoke.py --base-url "http://127.0.0.1:8082" +PASS: lab2 public API scenario; infrastructure and grading evidence remain separate. diff --git a/evidence/tests-final.txt b/evidence/tests-final.txt new file mode 100644 index 00000000..a59d6d5a --- /dev/null +++ b/evidence/tests-final.txt @@ -0,0 +1,3 @@ +BASE_URL=http://127.0.0.1:8082 uv run --locked pytest -q +............................................................. [100%] +61 passed in 17.63s diff --git a/evidence/tests-initial.txt b/evidence/tests-initial.txt new file mode 100644 index 00000000..d5d9371a --- /dev/null +++ b/evidence/tests-initial.txt @@ -0,0 +1,2 @@ +............................... [100%] +31 passed in 11.80s diff --git a/scripts/verify_pool.py b/scripts/verify_pool.py index 2da8f1a9..45264699 100644 --- a/scripts/verify_pool.py +++ b/scripts/verify_pool.py @@ -44,7 +44,7 @@ def main(): if path.exists(): raise SystemExit("Choose a new evidence filename") process = subprocess.run( - ["docker", "compose", "exec", "-T", "api", "python", "-c", PROBE], + ["docker", "compose", "run", "--rm", "--no-deps", "-T", "api", "python", "-c", PROBE], cwd=ROOT, capture_output=True, text=True,