{"id":14966484,"url":"https://github.com/insolita/pgjsonb_test","last_synced_at":"2026-01-23T11:49:39.112Z","repository":{"id":83983737,"uuid":"340043657","full_name":"Insolita/pgjsonb_test","owner":"Insolita","description":"Test postgres jsonb performance","archived":false,"fork":false,"pushed_at":"2021-02-18T19:40:22.000Z","size":12,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-12T05:32:09.408Z","etag":null,"topics":["jsonb","php","postgres","postgresql","yii","yii2"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Insolita.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-18T12:30:14.000Z","updated_at":"2023-03-03T07:59:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"6aa1e7d4-5720-4bc3-a35f-49a6892e40c3","html_url":"https://github.com/Insolita/pgjsonb_test","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"438496d0e7dfbef0e1abd25b6971e25e786e9647"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Insolita%2Fpgjsonb_test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Insolita%2Fpgjsonb_test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Insolita%2Fpgjsonb_test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Insolita%2Fpgjsonb_test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Insolita","download_url":"https://codeload.github.com/Insolita/pgjsonb_test/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248819352,"owners_count":21166474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jsonb","php","postgres","postgresql","yii","yii2"],"created_at":"2024-09-24T13:36:27.639Z","updated_at":"2026-01-23T11:49:39.046Z","avatar_url":"https://github.com/Insolita.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Postgres  benchmark attribute-value table vs JSONB for store user-defined forms data\n[ReadOnly]\n\n**Require PHP \u003e=7.4; composer; docker**\n\n### Usage\n - clone repo\n - run `make init` for install dependencies and run docker\n - run `make migrate` for prepare database structure\n - run `make seed` for fill databases with same fake data\n - run `make bench` for run test queries across all databases\n\n\n #### Results\n##### Legend:\n  simple - stored in table (field, value)\n  typed  - stored in table (field, value_bool, value_int, value_str, value_date... etc)\n  json - not indexed jsonb column\n  json_indx - btree indexed jsonb column\n\n[Show used queries](./app/queries)\n\n| query type                               |  pg10   | pg11   | pg12   | pg13   |\n|--------------------------------------|--------|--------|--------|--------|\n|Sort|||||\n| typed     | 0.143  | 0.1435 | 0.1246 | 0.1212 |\n| simple    | 0.1391 | 0.151  | 0.1229 | 0.1022 |\n| json      | 0.0982 | 0.0973 | 0.0949 | 0.0933 |\n| json_indx | 0.1    | 0.0963 | 0.0949 | 0.0928 |\n| Multi sort|||||\n| typed     | 0.185  | 0.1856 | 0.1655 | 0.1675 |\n| simple    | 0.1971 | 0.1853 | 0.1657 | 0.1382 |\n| json      | 0.1243 | 0.1148 | 0.1138 | 0.1124 |\n| json_indx | 0.13   | 0.1156 | 0.1147 | 0.1119 |\n| Date filter|||||\n| typed     | 0.1305 | 0.1356 | 0.112  | 0.1154 |\n| simple    | 0.1492 | 0.1439 | 0.1165 | 0.0931 |\n| json      | 0.055  | 0.0622 | 0.051  | 0.0542 |\n| json_indx | 0.056  | 0.0513 | 0.0515 | 0.0517 |\n| Json filter|||||\n| typed     | 0.1286 | 0.1209 | 0.1057 | 0.1073 |\n| simple    | 0.1417 | 0.1291 | 0.1094 | 0.0861 |\n| json      | 0.0152 | 0.0163 | 0.014  | 0.0174 |\n| json_indx | 0.0186 | 0.0212 | 0.015  | 0.0143 |\n| Foreign key inject|||||\n| typed     | 0.1748 | 0.0953 | 0.0906 | 0.1419 |\n| simple    | 0.1679 | 0.1653 | 0.1471 | 0.1199 |\n| json      | 0.1197 | 0.1124 | 0.111  | 0.1107 |\n| json_indx | 0.1169 | 0.1129 | 0.1106 | 0.1094 |\n| Group by count|||||\n| typed     | 0.146  | 0.1454 | 0.1334 | 0.1273 |\n| simple    | 0.1532 | 0.1489 | 0.1293 | 0.1012 |\n| json      | 0.0178 | 0.0139 | 0.0194 | 0.014  |\n| json_indx | 0.0173 | 0.0144 | 0.0143 | 0.0142 |\n| Filters by bool,json,int sort by int|||||\n| typed     | 0.0913 | 0.0919 | 0.0816 | 0.0805 |\n| simple    | 0.142  | 0.1315 | 0.1142 | 0.0993 |\n| json      | 0.0474 | 0.0399 | 0.0391 | 0.0378 |\n| json_indx | 0.0462 | 0.04   | 0.0388 | 0.0389 |\n| Inject fk, filter and sort by date|||||\n| typed     | 0.0396 | 0.034  | 0.0902 | 0.0366 |\n| simple    | 0.1656 | 0.1446 | 0.1269 | 0.1139 |\n| json      | 0.0472 | 0.0398 | 0.0389 | 0.0393 |\n| json_indx | 0.0408 | 0.0432 | 0.0469 | 0.0391 |\n| Average from filtered|||||\n| typed     | 0.0896 | 0.0783 | 0.0717 | 0.0683 |\n| simple    | 0.1317 | 0.1196 | 0.1034 | 0.0914 |\n| json      | 0.0246 | 0.0131 | 0.0133 | 0.0133 |\n| json_indx | 0.0285 | 0.0137 | 0.0135 | 0.0132 |\n| Filter greater than average value|||||\n| typed     | 0.1983 | 0.1797 | 0.1604 | 0.1597 |\n| simple    | 0.2658 | 0.2457 | 0.2119 | 0.1736 |\n| json      | 0.0463 | 0.0355 | 0.0351 | 0.0341 |\n| json_indx | 0.051  | 0.0369 | 0.0353 | 0.0344 |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsolita%2Fpgjsonb_test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finsolita%2Fpgjsonb_test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsolita%2Fpgjsonb_test/lists"}