UTC: 2026-10-07T14:01:48Z Hypothesis: composite index improves late-page reads, with additional write cost. 100000 rows, distribution 90/9/1%; three reads and 1000-row rollback writes per index. Limits: 1 CPU, 512MiB; single local Docker instance; no concurrent writes or PITR. Image: sha256:ef257d85f76e48da1c64832459b59fcaba1a4dac97bf5d7450c77753542eee94 2c8e791d08fca312f52a40e082b18dc82676e891df57c04fbca1334d5edcfa26 cmd/server/app.go 8fabb622999b681eb42452bfd349f71b53ad979e41f2ae57189d34c099bb3ee2 cmd/server/app_test.go 7290636ea31539d87bd97bb78cb28658409da966be8983e748ce1701f6f9f8f6 cmd/server/commands.go b0a0c1689dfe2db5abc889af13d7adb00a1d4f3d260b5ebe6d5f529cb5983a0e cmd/server/healthcheck.go 900039906536a81de51dc45af3904a7e44b4739d56690dd59f915d03d092c7e9 cmd/server/healthcheck_test.go 43ad9caf2260d8551b8b3e149681c5e66770e9901d72de41b81746cb0cac47ec cmd/server/logger.go c22d8cdf4ce31fde29945e967d3f025e280a7dc4d2022329d51be972d2a0f495 cmd/server/main.go 06b304d8f0cad20c206edbef8becab283c50c1722fd81c56a06f018dfe03bb7f cmd/server/persistence.go aaf096a8c0abb9e6860d5cd620a5b0580c130276374a09f21ac3a7790273385f cmd/server/persistence_test.go 41ef40897886c0878cbfe52f6716bdcb8433fb7eaddcfff298e1d54c55db423d internal/admission/distributed.go a373c9539167a4b7c35d45334d35ffd4e9d124c1740c88c12094fededd9643b4 internal/admission/limiter.go d52fb501e76ddb23c645c1aaa599e32da9d01e50064c9ca97ac0e320ffc7f0c8 internal/admission/limiter_test.go 8cb675a0bef8b1645071e4cb85b79a467620e99b375db5d8d3e16a54b4c5b5fa internal/config/config.go 0181673dcc4db2557783941aa8c5b3f61bc0ca6b5196d87e69df000346c40391 internal/config/config_test.go e784d7b934c4604065cd00bf4ff2b0c74741e759b1b7c81162adfc206d160153 internal/config/controller.go 027761b059b76898a84318ec1a8b43158d8bafd6e0b15b52efbe902b4d8c5ea3 internal/config/environment.go 3a69e20a00fa2ed816f344a990e9e0ef0077e1607d4207858b4b00e4ff5d1988 internal/config/logger.go 86cdf9e90b576f4484946bfd9605333fc52077f38d3a39c5d71ddca4cdeecda0 internal/config/memory.go 671f92c52c827989ce194f3928b02f707292022bb97d3c483410e97cf626b4af internal/config/persistence.go 7377c7fc286e04292b7c82e4e286cadf409ce833079f794a501456024e73434a internal/config/persistence_test.go af72da25fea9811c13a50c8133e9e8b35e070c5295069c40c0ae89cdc0aff19a internal/controller/fx.go 3107673b329dbe7934a29679024a18e3baada2cc99bee4d0ddbba0f9fd93edf9 internal/controller/http/fiber/auth.go 960cd6ea803ea4ef9b0231ce557fc5e792921aae343f33da6e8aca12495da39f internal/controller/http/fiber/auth_test.go 9c092ba7bca191f25c3ba9c9a5d1ca844126bee740a4c0262b776e947263ac68 internal/controller/http/fiber/chats_test.go be356cf26c228958d51f5bafa4305d7325e81ab01065575acbc9b2d7a6ddd4bd internal/controller/http/fiber/configure.go fd0d06ac838c8ceca1189303b98ce006ca1298381de49fe6d790d0f0f4007d3e internal/controller/http/fiber/controller.go 151fb360bc3f7309678961b7739c5d905f3430bc4e63fb6c9b26495e12ab7227 internal/controller/http/fiber/controller_test.go bb4216cb6c5813b66b51dc99a53f8cf09982789155305a099c321dd12fa8e2de internal/controller/http/fiber/decode.go 6ee07f110bdb29d8d2191ab8889ba60474b33a5b225739875c8a57d8434be15d internal/controller/http/fiber/dependencies.go 3351a019c43d0360ee0fd68afabb5200422d065ae7bd908b1c0a5c02a0c1ad41 internal/controller/http/fiber/error_codes.go 9d5da8d98ece2706e324cb2deca915e0811b6ad98f7aaac5805ca0f3cc0a1f9a internal/controller/http/fiber/error_registry.go d502e2a9f7fe3980c10c2760c31711794898c539d07b43b02497dc2cfb870358 internal/controller/http/fiber/errors.go 81e95e02b6e41929bf8e73f65e2d4921fc6471293815d590d38ad7d849106f3c internal/controller/http/fiber/errors_test.go 49bb58b260f2df9473d8e0ae01b8c3c742e4266db00d64fe5e999730aba42a80 internal/controller/http/fiber/fixtures_auth_test.go 59e3f16adc94b7426c74e2f40b5ff18a9129c80fc619cb8144110bdeec095021 internal/controller/http/fiber/handlers.go d32a9a01a8b391f4d986e14947a25a0504f4363335ea1524df05e0dd8e9e61bd internal/controller/http/fiber/headers.go 6d18f3c4be98e70a7e61d82b014b6db9b3a5e594c9b5f50ecea88f89bd6917cd internal/controller/http/fiber/health.go f39cf7a0049a2ed39d6cc1fcc66b44656d9d6120914d0e973b032e12f3d0de08 internal/controller/http/fiber/lifecycle.go 496f50e5693456574614b8a47086a550018884adb37919ce82abf8c4e7e5254d internal/controller/http/fiber/lifecycle_test.go f63d4b0e2ee5f62c4d0d8c4b26a8734d68230af4577e3c6cb71a92525c3c8681 internal/controller/http/fiber/mapping.go d848e00aff04d7a3339ca1847f47cad59fb7c05085f6cfb1965b27df516acdd6 internal/controller/http/fiber/messages_test.go 34fd687af80730601ba9276ef606fee76df84d14b4400a65ec5b804897673536 internal/controller/http/fiber/middleware.go 5259d44ea6c7d4e1776f5b66e00408d1450fdf859e2017bf14937d3020f3dcff internal/controller/http/fiber/middleware_test.go d806c2d026a8ff2fc54d60b62c062e80a3532e652fcfa5c3105684ba17cc9f67 internal/controller/http/fiber/public_errors.go 47089b63442f02d6e637a8dd785e323e97efb15fd82d2ffa303e7e10de4876cd internal/controller/http/fiber/public_errors_test.go 826fe61b8d59465de7190c175b6abaa118f4a7deacdb1b9c628e25bb7f4feb3b internal/controller/http/fiber/routes.go 0b3fad8fc87f561573bf4ee906a48a8fb317385ecc7600bdca3cc61992fa9253 internal/controller/http/fiber/users_test.go 24b6b06d6fab919cd2130697b44fd0d358265184dca0ca8362e0b4fcc2ae5a68 internal/controller/interface.go a5bc7aac6d1764929fb11365c9f8b6a45ff65e47b3a317a7ccd9ec6dd1b2713a internal/cursor/codec.go a611b59197a205fd21fd94077577f2db7024266cd5ce8a5bfb18a85196bd357b internal/cursor/codec_test.go e205901cec2e66011ec764b70879b0eb0d28a78c4dea8913a9fb30c2d778fa8c internal/hashring/ring.go 606cdf84342b97a63eedfb9cd37aa7c99a489eee54641d8645be930a9ce6be0d internal/hashring/ring_test.go e2ecd732848d10f4471567c9603aa7359fcb1af7b2708ead477f4949f7a2fa4a internal/model/dto/models.go 896a694b0c217240343077d4287f4a6e447338c38571abbebcb3d16a519137fb internal/model/dto/session.go 8c183b065bc3ab4cad20570eab79f334ca75a3309186fdf832fb1aa598894465 internal/model/http/models.go fe2df6990331573bbf0202ebc81c58263a7c16a29b713eefa0f0e852e4ee4a76 internal/password/password.go 1ad8dcb7d055fcb8da56d10e1089b47fe1b9cbf848381ded1a4048f8fd41278a internal/password/password_test.go ede0474befff6773779dd448e9b42a98bd2edb12033b65366e5f65618ec4885e internal/service/auth.go 1cc82be87998dc9b66216965dc3ac37aa6c210c1007fc46a2a0bd698e9cb6167 internal/service/authentication/service.go c77137c6799dc1f9012387e45c21414ced2d7e0923b6f2750a09f61b76c6523a internal/service/authentication/service_test.go 55baf7ba65292ae6a75b7a6af8d304886f35c7ad854b8d700251d6f32c964dbf internal/service/cache.go 07244e89d9948087318df2dfecfb3a648c217bc313fb033748f5562e08ba8a95 internal/service/cursor.go e19c47379f63a5ee7e24b9b0fded1eb326ea231392b4e27c324d205d4c620f7d internal/service/errors.go 017b13007719a32a8eec26527848231381590e5632790bedec66a126776bad6e internal/service/interface.go fc191b98aaf0488cb60f258c3ce9788708818c7f299a10f80e91568adabd05e5 internal/service/production/access.go af0659140715e467ab15388cc75aea8b2ff09b8edbbd5dc90aa6d3f5c24bf5bf internal/service/production/cache_test.go 881f9269ad84ab5dc091fdec8ad6c36bebd2eaac0da0685b8d333216e0a2dd16 internal/service/production/chats.go 8eb5b603aeb7be2d5e5af859762610e26c8ad7c05fa222e04802950dd71f9c21 internal/service/production/chats_page_test.go e7d4fa61a14f7cb4ba421ed5e83d794a85b42fac597e269807d564c830e2cbb8 internal/service/production/chats_test.go fe5940f705df32902151d51f82c7f9f1df3e274e62413d9e1b54f2a512707d48 internal/service/production/creation.go 7495818188cc13028d9400dfa18005e9aa334ac048b7a84150dd2b6ddb28d796 internal/service/production/errors.go 007b27ba3005a3040283b35b7640523bc8ae04ada89b2731396b1559c3b20075 internal/service/production/fixture_test.go 1f5c9335bf4cf5b9f4137454e3ca22975e7c6c7118e4e60bb470851f8a7cd61e internal/service/production/members.go 6bdd523dd8be7ce139a0a7f2c9ee16d8d2f03e4d15ed00e7a31658c23fb97c17 internal/service/production/messages.go 7b82f74aedb2f26079cce497778302246e9166c365508e37266a97078df5ca5c internal/service/production/messages_page_test.go 6722838a6c117f76fb2710d664ec4ce9945479f18013af18437cf93814351d93 internal/service/production/messages_test.go 4306cd592bdcd2dd5c31eeadc0dc5e1a59b275ffa6de091032edf644171020c5 internal/service/production/pages.go f0611bc8ad150fcac5505a6696bd293a144274431fb71b3e96f16a8229b85bcc internal/service/production/pages_test.go 4cb0d47ef9cc020e608f93a8257b6d65136f6f74b86c3f591f19dad688fc7bf0 internal/service/production/pagination.go 1886cbbaa88de20d0e21bf6c1c35fde64164547fa86c1fb74860c93f59b5fc9b internal/service/production/pagination_test.go 70fb90d812432e321c4fca1b1e2141cfad91453e294f4efda60c0898be686d7d internal/service/production/service.go b8ab1e6e92a365f38fb5ac660e311a00fea6a458c6c9cd9c8184dbaebb419f50 internal/service/production/service_test.go 50d873980bdc97a799c2e61a4b25c5bd222a32bd7baed28590510ef373ac0461 internal/service/production/users.go 04e0cb7a51877014ef23a8063ca435e3eb5e98fb78902ff166abc08139287315 internal/service/production/users_test.go 6aa0ff490fe8fca8b906b5073e0914a64369ddfc7d0648d895cc41cb69cdd2e0 internal/service/production/validation.go ea599de0e0d2a0be7de7b0835307a4d1852db16a49bfad3636f7c30b85181fce internal/store/interface.go ac2aafe9f19706ff39b16a4ca1b1e142f6e52bef160ef591f9f2120d106ffd51 internal/store/memory/capacity.go 150851ac6a0d5da8835a9aaaa7c1156b075e5e3dd962698fb483b0afa8a2097f internal/store/memory/chats.go 3036029e86462d8cf52aad993c4f9eff62a5cf0454e757b871abfd5b4902c9f5 internal/store/memory/chats_test.go 94f2a5ce429aa8280e1333760309fd1d02b314310cbdea495aef56a63ed145b1 internal/store/memory/messages.go 76f977bbabec7550093ca9d376efc9686345198cbee5e13ce31d38dcd425a469 internal/store/memory/messages_test.go 4aef07be1cb907cfa7a4a3d78060d8be57c9ff566c16e729dea9b0db68c7dfae internal/store/memory/ordering.go f463d530955bfe5793fb9a4ad93d6615a3ce923d1d4719b8c515f487c96997ca internal/store/memory/store.go b7f8237e22eac473ad47cd879238aed7ed16e08b28a6ff3029ddcc58072dfe0e internal/store/memory/store_test.go 1652a23bc8fc29a6ef00851a19d4547b660f3bfcce9d458b7381db5b3f30778c internal/store/memory/users.go dc9a73504116b7e54d38a4e3b8c88ed1aa4c1144efdb9bb3ac671e0e1182d9a3 internal/store/memory/users_test.go b9d69046cd919957434da02c635d259c8e36f27371270afedc312947eb5bb615 internal/store/postgres/chats.go 1ab5dd2f8d81697a57ee89e1969995e52bfccc0f3f25a5c480822e41313988f1 internal/store/postgres/messages.go 8b8bf6a255cc48cee4b3e4adc94c23cf6955ecf5dfba689bba973dfccbd1b1cb internal/store/postgres/migrations/001_initial.sql 6f7f2e86822d806640888da990716279659fe90e5a74b3b0d5454a5155d0334b internal/store/postgres/sessions.go 5f3e022a414103198a1ab8e62f337e67c22afd1afddda400884b79a5e51488a2 internal/store/postgres/store.go 538f1739eae4c276aa6b5df9aa8c4f4c3aca4a3043a71650256f257ffaaed029 internal/store/postgres/store_test.go 2721381975755efe2a4f14a8df3c1189d2dcc6c7933fc25292977014c26aa220 internal/store/postgres/users.go ef9bfaf3bd684fded87c92a15b3e5c706a794caf04cc4ef711c4185e9c7fb12a internal/strictjson/decode.go ea6273526572b4bfcf681ef2659ea2c1ec74bfedeb5e9bdbd83ebfabe0647bf9 internal/strictjson/decode_test.go 4baa4e399be201189371d1ace6169e56958251386624af4996fac04e0ab5d1f7 internal/valkey/admission.go 693b866a740b6d5f765221be4c6489391821d4b58942cf0ff36030163dbae6a9 internal/valkey/cache.go 86acf0827e1d29993eda7ee62a8fa42b02d707330a94a70f5a3933911407e882 internal/valkey/client.go b39e08ecc720e1d4fc81d342fa15192c0a0a82e849231161c1e0d2da2d8f625d internal/valkey/client_test.go 5ea8c967f238b30a5f54ced22b0318832254ff99e5bcc4af145aee08d7f8c8da scripts/research.sh f47019141be4ac06d912cbd4281d94d181625a08637801627e897633bb20a124 student-tests/plans.sql f7ca02dfce0db42f72594d794eda5821a9125e7a2b6966df731f32869a5f0b43 student-tests/research.sql Timing is on. PostgreSQL 17.6 on aarch64-unknown-linux-musl, compiled by gcc (Alpine 14.2.0) 14.2.0, 64-bit Time: 0.459 ms INSERT 0 1 Time: 0.790 ms INSERT 0 3 Time: 1.172 ms INSERT 0 3 Time: 0.978 ms INSERT 0 100000 Time: 1729.487 ms (00:01.729) DROP INDEX Time: 1.273 ms CREATE INDEX Time: 13.915 ms VARIANT: chat_only ANALYZE Time: 35.241 ms [ { "Plan": { "Node Type": "Limit", "Parallel Aware": false, "Async Capable": false, "Startup Cost": 3686.59, "Total Cost": 3686.72, "Plan Rows": 51, "Plan Width": 71, "Actual Startup Time": 4.354, "Actual Total Time": 4.358, "Actual Rows": 51, "Actual Loops": 1, "Shared Hit Blocks": 1235, "Shared Read Blocks": 0, "Shared Dirtied Blocks": 0, "Shared Written Blocks": 0, "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": 3686.59, "Total Cost": 3720.43, "Plan Rows": 13536, "Plan Width": 71, "Actual Startup Time": 4.354, "Actual Total Time": 4.355, "Actual Rows": 51, "Actual Loops": 1, "Sort Key": ["created_at", "id"], "Sort Method": "top-N heapsort", "Sort Space Used": 31, "Sort Space Type": "Memory", "Shared Hit Blocks": 1235, "Shared Read Blocks": 0, "Shared Dirtied Blocks": 0, "Shared Written Blocks": 0, "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": "Seq Scan", "Parent Relationship": "Outer", "Parallel Aware": false, "Async Capable": false, "Relation Name": "messages", "Alias": "messages", "Startup Cost": 0.00, "Total Cost": 3235.00, "Plan Rows": 13536, "Plan Width": 71, "Actual Startup Time": 3.486, "Actual Total Time": 4.129, "Actual Rows": 5000, "Actual Loops": 1, "Filter": "((chat_id = 'c4ca4238-a0b9-2382-0dcc-509a6f75849b'::uuid) AND (ROW(created_at, id) > ROW(('2026-01-01 00:00:00+00'::timestamp with time zone + '00:00:00.085'::interval), 'dedbbd60-c592-c7ad-b64f-8ef8f0a025dc'::uuid)))", "Rows Removed by Filter": 95000, "Shared Hit Blocks": 1235, "Shared Read Blocks": 0, "Shared Dirtied Blocks": 0, "Shared Written Blocks": 0, "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": 33, "Shared Read Blocks": 1, "Shared Dirtied Blocks": 0, "Shared Written Blocks": 0, "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.132, "Triggers": [ ], "Execution Time": 4.380 } ] BEGIN [ { "Plan": { "Node Type": "ModifyTable", "Operation": "Insert", "Parallel Aware": false, "Async Capable": false, "Relation Name": "messages", "Alias": "messages", "Startup Cost": 0.00, "Total Cost": 37.50, "Plan Rows": 0, "Plan Width": 0, "Actual Startup Time": 3.636, "Actual Total Time": 3.636, "Actual Rows": 0, "Actual Loops": 1, "Shared Hit Blocks": 6037, "Shared Read Blocks": 3, "Shared Dirtied Blocks": 22, "Shared Written Blocks": 19, "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": "Function Scan", "Parent Relationship": "Outer", "Parallel Aware": false, "Async Capable": false, "Function Name": "generate_series", "Alias": "n", "Startup Cost": 0.00, "Total Cost": 37.50, "Plan Rows": 1000, "Plan Width": 88, "Actual Startup Time": 0.034, "Actual Total Time": 1.017, "Actual Rows": 1000, "Actual Loops": 1, "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": { "Shared Hit Blocks": 0, "Shared Read Blocks": 0, "Shared Dirtied Blocks": 0, "Shared Written Blocks": 0, "Local Hit Blocks": 0, "Local Read Blocks": 0, "Local Dirtied Blocks": 0, "Local Written Blocks": 0, "Temp Read Blocks": 0, "Temp Written Blocks": 0 }, "Planning Time": 0.048, "Triggers": [ { "Trigger Name": "RI_ConstraintTrigger_c_16431", "Constraint Name": "messages_chat_id_fkey", "Relation": "messages", "Time": 5.081, "Calls": 1000 }, { "Trigger Name": "RI_ConstraintTrigger_c_16436", "Constraint Name": "messages_sender_id_fkey", "Relation": "messages", "Time": 4.982, "Calls": 1000 }, { "Trigger Name": "RI_ConstraintTrigger_c_16441", "Constraint Name": "messages_chat_id_sender_id_fkey", "Relation": "messages", "Time": 5.075, "Calls": 1000 } ], "Execution Time": 18.904 } ] ROLLBACK Time: 24.006 ms [ { "Plan": { "Node Type": "Limit", "Parallel Aware": false, "Async Capable": false, "Startup Cost": 3725.42, "Total Cost": 3725.55, "Plan Rows": 51, "Plan Width": 71, "Actual Startup Time": 4.327, "Actual Total Time": 4.331, "Actual Rows": 51, "Actual Loops": 1, "Shared Hit Blocks": 1248, "Shared Read Blocks": 0, "Shared Dirtied Blocks": 0, "Shared Written Blocks": 0, "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": 3725.42, "Total Cost": 3759.62, "Plan Rows": 13679, "Plan Width": 71, "Actual Startup Time": 4.327, "Actual Total Time": 4.328, "Actual Rows": 51, "Actual Loops": 1, "Sort Key": ["created_at", "id"], "Sort Method": "top-N heapsort", "Sort Space Used": 31, "Sort Space Type": "Memory", "Shared Hit Blocks": 1248, "Shared Read Blocks": 0, "Shared Dirtied Blocks": 0, "Shared Written Blocks": 0, "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": "Seq Scan", "Parent Relationship": "Outer", "Parallel Aware": false, "Async Capable": false, "Relation Name": "messages", "Alias": "messages", "Startup Cost": 0.00, "Total Cost": 3269.06, "Plan Rows": 13679, "Plan Width": 71, "Actual Startup Time": 3.501, "Actual Total Time": 4.113, "Actual Rows": 5000, "Actual Loops": 1, "Filter": "((chat_id = 'c4ca4238-a0b9-2382-0dcc-509a6f75849b'::uuid) AND (ROW(created_at, id) > ROW(('2026-01-01 00:00:00+00'::timestamp with time zone + '00:00:00.085'::interval), 'dedbbd60-c592-c7ad-b64f-8ef8f0a025dc'::uuid)))", "Rows Removed by Filter": 95000, "Shared Hit Blocks": 1248, "Shared Read Blocks": 0, "Shared Dirtied Blocks": 0, "Shared Written Blocks": 0, "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.080, "Triggers": [ ], "Execution Time": 4.347 } ] BEGIN [ { "Plan": { "Node Type": "ModifyTable", "Operation": "Insert", "Parallel Aware": false, "Async Capable": false, "Relation Name": "messages", "Alias": "messages", "Startup Cost": 0.00, "Total Cost": 37.50, "Plan Rows": 0, "Plan Width": 0, "Actual Startup Time": 3.093, "Actual Total Time": 3.093, "Actual Rows": 0, "Actual Loops": 1, "Shared Hit Blocks": 7044, "Shared Read Blocks": 0, "Shared Dirtied Blocks": 15, "Shared Written Blocks": 15, "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": "Function Scan", "Parent Relationship": "Outer", "Parallel Aware": false, "Async Capable": false, "Function Name": "generate_series", "Alias": "n", "Startup Cost": 0.00, "Total Cost": 37.50, "Plan Rows": 1000, "Plan Width": 88, "Actual Startup Time": 0.041, "Actual Total Time": 0.944, "Actual Rows": 1000, "Actual Loops": 1, "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": { "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": [ { "Trigger Name": "RI_ConstraintTrigger_c_16431", "Constraint Name": "messages_chat_id_fkey", "Relation": "messages", "Time": 4.676, "Calls": 1000 }, { "Trigger Name": "RI_ConstraintTrigger_c_16436", "Constraint Name": "messages_sender_id_fkey", "Relation": "messages", "Time": 4.557, "Calls": 1000 }, { "Trigger Name": "RI_ConstraintTrigger_c_16441", "Constraint Name": "messages_chat_id_sender_id_fkey", "Relation": "messages", "Time": 4.767, "Calls": 1000 } ], "Execution Time": 17.223 } ] ROLLBACK Time: 21.961 ms [ { "Plan": { "Node Type": "Limit", "Parallel Aware": false, "Async Capable": false, "Startup Cost": 3767.18, "Total Cost": 3767.31, "Plan Rows": 51, "Plan Width": 71, "Actual Startup Time": 4.047, "Actual Total Time": 4.051, "Actual Rows": 51, "Actual Loops": 1, "Shared Hit Blocks": 1262, "Shared Read Blocks": 0, "Shared Dirtied Blocks": 0, "Shared Written Blocks": 0, "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": 3767.18, "Total Cost": 3801.76, "Plan Rows": 13832, "Plan Width": 71, "Actual Startup Time": 4.047, "Actual Total Time": 4.049, "Actual Rows": 51, "Actual Loops": 1, "Sort Key": ["created_at", "id"], "Sort Method": "top-N heapsort", "Sort Space Used": 31, "Sort Space Type": "Memory", "Shared Hit Blocks": 1262, "Shared Read Blocks": 0, "Shared Dirtied Blocks": 0, "Shared Written Blocks": 0, "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": "Seq Scan", "Parent Relationship": "Outer", "Parallel Aware": false, "Async Capable": false, "Relation Name": "messages", "Alias": "messages", "Startup Cost": 0.00, "Total Cost": 3305.72, "Plan Rows": 13832, "Plan Width": 71, "Actual Startup Time": 3.225, "Actual Total Time": 3.843, "Actual Rows": 5000, "Actual Loops": 1, "Filter": "((chat_id = 'c4ca4238-a0b9-2382-0dcc-509a6f75849b'::uuid) AND (ROW(created_at, id) > ROW(('2026-01-01 00:00:00+00'::timestamp with time zone + '00:00:00.085'::interval), 'dedbbd60-c592-c7ad-b64f-8ef8f0a025dc'::uuid)))", "Rows Removed by Filter": 95000, "Shared Hit Blocks": 1262, "Shared Read Blocks": 0, "Shared Dirtied Blocks": 0, "Shared Written Blocks": 0, "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.048, "Triggers": [ ], "Execution Time": 4.062 } ] BEGIN [ { "Plan": { "Node Type": "ModifyTable", "Operation": "Insert", "Parallel Aware": false, "Async Capable": false, "Relation Name": "messages", "Alias": "messages", "Startup Cost": 0.00, "Total Cost": 37.50, "Plan Rows": 0, "Plan Width": 0, "Actual Startup Time": 2.858, "Actual Total Time": 2.859, "Actual Rows": 0, "Actual Loops": 1, "Shared Hit Blocks": 7056, "Shared Read Blocks": 0, "Shared Dirtied Blocks": 14, "Shared Written Blocks": 14, "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": "Function Scan", "Parent Relationship": "Outer", "Parallel Aware": false, "Async Capable": false, "Function Name": "generate_series", "Alias": "n", "Startup Cost": 0.00, "Total Cost": 37.50, "Plan Rows": 1000, "Plan Width": 88, "Actual Startup Time": 0.028, "Actual Total Time": 0.876, "Actual Rows": 1000, "Actual Loops": 1, "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": { "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": [ { "Trigger Name": "RI_ConstraintTrigger_c_16431", "Constraint Name": "messages_chat_id_fkey", "Relation": "messages", "Time": 4.890, "Calls": 1000 }, { "Trigger Name": "RI_ConstraintTrigger_c_16436", "Constraint Name": "messages_sender_id_fkey", "Relation": "messages", "Time": 4.752, "Calls": 1000 }, { "Trigger Name": "RI_ConstraintTrigger_c_16441", "Constraint Name": "messages_chat_id_sender_id_fkey", "Relation": "messages", "Time": 5.050, "Calls": 1000 } ], "Execution Time": 17.684 } ] ROLLBACK Time: 22.065 ms Time: 0.119 ms DROP INDEX Time: 1.160 ms CREATE INDEX Time: 25.346 ms VARIANT: history_keyset ANALYZE Time: 29.509 ms [ { "Plan": { "Node Type": "Limit", "Parallel Aware": false, "Async Capable": false, "Startup Cost": 0.42, "Total Cost": 11.77, "Plan Rows": 51, "Plan Width": 71, "Actual Startup Time": 0.019, "Actual Total Time": 0.024, "Actual Rows": 51, "Actual Loops": 1, "Shared Hit Blocks": 2, "Shared Read Blocks": 3, "Shared Dirtied Blocks": 0, "Shared Written Blocks": 0, "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": "candidate", "Relation Name": "messages", "Alias": "messages", "Startup Cost": 0.42, "Total Cost": 2986.47, "Plan Rows": 13418, "Plan Width": 71, "Actual Startup Time": 0.019, "Actual Total Time": 0.022, "Actual Rows": 51, "Actual Loops": 1, "Index Cond": "((chat_id = 'c4ca4238-a0b9-2382-0dcc-509a6f75849b'::uuid) AND (ROW(created_at, id) > ROW(('2026-01-01 00:00:00+00'::timestamp with time zone + '00:00:00.085'::interval), 'dedbbd60-c592-c7ad-b64f-8ef8f0a025dc'::uuid)))", "Rows Removed by Index Recheck": 0, "Shared Hit Blocks": 2, "Shared Read Blocks": 3, "Shared Dirtied Blocks": 0, "Shared Written Blocks": 0, "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": 28, "Shared Read Blocks": 1, "Shared Dirtied Blocks": 0, "Shared Written Blocks": 0, "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.145, "Triggers": [ ], "Execution Time": 0.034 } ] BEGIN [ { "Plan": { "Node Type": "ModifyTable", "Operation": "Insert", "Parallel Aware": false, "Async Capable": false, "Relation Name": "messages", "Alias": "messages", "Startup Cost": 0.00, "Total Cost": 37.50, "Plan Rows": 0, "Plan Width": 0, "Actual Startup Time": 3.555, "Actual Total Time": 3.555, "Actual Rows": 0, "Actual Loops": 1, "Shared Hit Blocks": 8094, "Shared Read Blocks": 3, "Shared Dirtied Blocks": 29, "Shared Written Blocks": 26, "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": "Function Scan", "Parent Relationship": "Outer", "Parallel Aware": false, "Async Capable": false, "Function Name": "generate_series", "Alias": "n", "Startup Cost": 0.00, "Total Cost": 37.50, "Plan Rows": 1000, "Plan Width": 88, "Actual Startup Time": 0.032, "Actual Total Time": 0.919, "Actual Rows": 1000, "Actual Loops": 1, "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": { "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.028, "Triggers": [ { "Trigger Name": "RI_ConstraintTrigger_c_16431", "Constraint Name": "messages_chat_id_fkey", "Relation": "messages", "Time": 4.942, "Calls": 1000 }, { "Trigger Name": "RI_ConstraintTrigger_c_16436", "Constraint Name": "messages_sender_id_fkey", "Relation": "messages", "Time": 4.895, "Calls": 1000 }, { "Trigger Name": "RI_ConstraintTrigger_c_16441", "Constraint Name": "messages_chat_id_sender_id_fkey", "Relation": "messages", "Time": 5.082, "Calls": 1000 } ], "Execution Time": 18.613 } ] ROLLBACK Time: 19.066 ms [ { "Plan": { "Node Type": "Limit", "Parallel Aware": false, "Async Capable": false, "Startup Cost": 0.42, "Total Cost": 11.78, "Plan Rows": 51, "Plan Width": 71, "Actual Startup Time": 0.013, "Actual Total Time": 0.020, "Actual Rows": 51, "Actual Loops": 1, "Shared Hit Blocks": 5, "Shared Read Blocks": 0, "Shared Dirtied Blocks": 0, "Shared Written Blocks": 0, "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": "candidate", "Relation Name": "messages", "Alias": "messages", "Startup Cost": 0.42, "Total Cost": 3020.50, "Plan Rows": 13554, "Plan Width": 71, "Actual Startup Time": 0.013, "Actual Total Time": 0.017, "Actual Rows": 51, "Actual Loops": 1, "Index Cond": "((chat_id = 'c4ca4238-a0b9-2382-0dcc-509a6f75849b'::uuid) AND (ROW(created_at, id) > ROW(('2026-01-01 00:00:00+00'::timestamp with time zone + '00:00:00.085'::interval), 'dedbbd60-c592-c7ad-b64f-8ef8f0a025dc'::uuid)))", "Rows Removed by Index Recheck": 0, "Shared Hit Blocks": 5, "Shared Read Blocks": 0, "Shared Dirtied Blocks": 0, "Shared Written Blocks": 0, "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.054, "Triggers": [ ], "Execution Time": 0.029 } ] BEGIN [ { "Plan": { "Node Type": "ModifyTable", "Operation": "Insert", "Parallel Aware": false, "Async Capable": false, "Relation Name": "messages", "Alias": "messages", "Startup Cost": 0.00, "Total Cost": 37.50, "Plan Rows": 0, "Plan Width": 0, "Actual Startup Time": 3.419, "Actual Total Time": 3.419, "Actual Rows": 0, "Actual Loops": 1, "Shared Hit Blocks": 8061, "Shared Read Blocks": 0, "Shared Dirtied Blocks": 15, "Shared Written Blocks": 15, "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": "Function Scan", "Parent Relationship": "Outer", "Parallel Aware": false, "Async Capable": false, "Function Name": "generate_series", "Alias": "n", "Startup Cost": 0.00, "Total Cost": 37.50, "Plan Rows": 1000, "Plan Width": 88, "Actual Startup Time": 0.032, "Actual Total Time": 0.918, "Actual Rows": 1000, "Actual Loops": 1, "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": { "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.022, "Triggers": [ { "Trigger Name": "RI_ConstraintTrigger_c_16431", "Constraint Name": "messages_chat_id_fkey", "Relation": "messages", "Time": 4.698, "Calls": 1000 }, { "Trigger Name": "RI_ConstraintTrigger_c_16436", "Constraint Name": "messages_sender_id_fkey", "Relation": "messages", "Time": 4.610, "Calls": 1000 }, { "Trigger Name": "RI_ConstraintTrigger_c_16441", "Constraint Name": "messages_chat_id_sender_id_fkey", "Relation": "messages", "Time": 4.897, "Calls": 1000 } ], "Execution Time": 17.747 } ] ROLLBACK Time: 18.036 ms [ { "Plan": { "Node Type": "Limit", "Parallel Aware": false, "Async Capable": false, "Startup Cost": 0.42, "Total Cost": 11.77, "Plan Rows": 51, "Plan Width": 71, "Actual Startup Time": 0.011, "Actual Total Time": 0.017, "Actual Rows": 51, "Actual Loops": 1, "Shared Hit Blocks": 5, "Shared Read Blocks": 0, "Shared Dirtied Blocks": 0, "Shared Written Blocks": 0, "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": "candidate", "Relation Name": "messages", "Alias": "messages", "Startup Cost": 0.42, "Total Cost": 3049.09, "Plan Rows": 13702, "Plan Width": 71, "Actual Startup Time": 0.010, "Actual Total Time": 0.014, "Actual Rows": 51, "Actual Loops": 1, "Index Cond": "((chat_id = 'c4ca4238-a0b9-2382-0dcc-509a6f75849b'::uuid) AND (ROW(created_at, id) > ROW(('2026-01-01 00:00:00+00'::timestamp with time zone + '00:00:00.085'::interval), 'dedbbd60-c592-c7ad-b64f-8ef8f0a025dc'::uuid)))", "Rows Removed by Index Recheck": 0, "Shared Hit Blocks": 5, "Shared Read Blocks": 0, "Shared Dirtied Blocks": 0, "Shared Written Blocks": 0, "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.035, "Triggers": [ ], "Execution Time": 0.024 } ] BEGIN [ { "Plan": { "Node Type": "ModifyTable", "Operation": "Insert", "Parallel Aware": false, "Async Capable": false, "Relation Name": "messages", "Alias": "messages", "Startup Cost": 0.00, "Total Cost": 37.50, "Plan Rows": 0, "Plan Width": 0, "Actual Startup Time": 3.376, "Actual Total Time": 3.377, "Actual Rows": 0, "Actual Loops": 1, "Shared Hit Blocks": 8091, "Shared Read Blocks": 0, "Shared Dirtied Blocks": 13, "Shared Written Blocks": 13, "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": "Function Scan", "Parent Relationship": "Outer", "Parallel Aware": false, "Async Capable": false, "Function Name": "generate_series", "Alias": "n", "Startup Cost": 0.00, "Total Cost": 37.50, "Plan Rows": 1000, "Plan Width": 88, "Actual Startup Time": 0.032, "Actual Total Time": 0.926, "Actual Rows": 1000, "Actual Loops": 1, "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": { "Shared Hit Blocks": 0, "Shared Read Blocks": 0, "Shared Dirtied Blocks": 0, "Shared Written Blocks": 0, "Local Hit Blocks": 0, "Local Read Blocks": 0, "Local Dirtied Blocks": 0, "Local Written Blocks": 0, "Temp Read Blocks": 0, "Temp Written Blocks": 0 }, "Planning Time": 0.021, "Triggers": [ { "Trigger Name": "RI_ConstraintTrigger_c_16431", "Constraint Name": "messages_chat_id_fkey", "Relation": "messages", "Time": 9.403, "Calls": 1000 }, { "Trigger Name": "RI_ConstraintTrigger_c_16436", "Constraint Name": "messages_sender_id_fkey", "Relation": "messages", "Time": 4.799, "Calls": 1000 }, { "Trigger Name": "RI_ConstraintTrigger_c_16441", "Constraint Name": "messages_chat_id_sender_id_fkey", "Relation": "messages", "Time": 4.972, "Calls": 1000 } ], "Execution Time": 22.682 } ] ROLLBACK Time: 22.961 ms Time: 0.139 ms real 0m0.277s user 0m0.020s sys 0m0.047s real 0m0.469s user 0m0.019s sys 0m0.027s PASS: restore row count and checksum match 100000|452ef7ddb29fb8f662613e2f14934870 15684027 id | text --------------------------------------+------------------ 1017bfd4-6739-55ff-ee46-41ad3d481b1c | synthetic-50000 14ee22ea-ba29-7944-c96a-fdbe5b16c65b | synthetic-100000 c4ca4238-a0b9-2382-0dcc-509a6f75849b | synthetic-1 (3 rows)