{"id":19458524,"url":"https://github.com/postgrespro/lsm3","last_synced_at":"2025-04-25T06:30:29.097Z","repository":{"id":149601018,"uuid":"281170008","full_name":"postgrespro/lsm3","owner":"postgrespro","description":"LSM tree implementation based on standard B-Tree","archived":false,"fork":false,"pushed_at":"2022-12-15T08:16:40.000Z","size":185,"stargazers_count":32,"open_issues_count":8,"forks_count":1,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-24T10:48:41.618Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/postgrespro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2020-07-20T16:30:56.000Z","updated_at":"2025-02-13T14:13:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"4ac7d3ca-74c8-46db-ae39-9ba209ca0d84","html_url":"https://github.com/postgrespro/lsm3","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postgrespro%2Flsm3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postgrespro%2Flsm3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postgrespro%2Flsm3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postgrespro%2Flsm3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/postgrespro","download_url":"https://codeload.github.com/postgrespro/lsm3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250766958,"owners_count":21483894,"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":[],"created_at":"2024-11-10T17:27:25.711Z","updated_at":"2025-04-25T06:30:29.092Z","avatar_url":"https://github.com/postgrespro.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"LSM tree implemented using standard Postgres B-Tree indexes.\nTop index is used to perform fast inserts and on overflow it is merged\nwith base index. To perform merge operation concurrently\nwithout blocking other operations with index, two top indexes are used:\nactive and merged. So totally there are three B-Tree indexes:\ntwo top indexes and one base index.\nWhen performing index scan we have to merge scans of all this three indexes.\n\nThis extension needs to create data structure in shared memory and this is why it should be loaded through\n\"shared_preload_library\" list. Once extension is created, you can define indexes using lsm3 access method:\n\n```sql\ncreate extension lsm3;\ncreate table t(id integer, val text);\ncreate index idx on t using lsm3(id);\n```\n\n`Lsm3` provides for the same types and set of operations as standard B-Tree.\n\nCurrent restrictions of `Lsm3`:\n- Parallel index scan is not supported.\n- Array keys are not supported.\n- `Lsm3` index can not be declared as unique.\n\n`Lsm3` extension can be configured using the following parameters:\n- `lsm3.max_indexes`: maximal number of Lsm3 indexes (default 1024).\n- `lsm3.top_index_size`: size (kb) of top index (default 64Mb).\n\nIt is also possible to specify size of top index in relation options - this value will override `lsm3.top_index_size` GUC.\n\nAlthough unique constraint can not be enforced using Lsm3 index, it is still possible to mark index as unique to\noptimize index search. If index is marked as unique and searched key is found in active\ntop index, then lookup in other two indexes is not performed. As far as application is most frequently\nsearching for last recently inserted data, we can speedup this search by performing just one index lookup instead of 3.\nIndex can be marked as unique using index options:\n\n```sql\ncreate index idx on t using lsm3(id) with (unique=true);\n```\n\nPlease notice that Lsm3 creates bgworker merge process for each Lsm3 index.\nSo you may need to adjust `max_worker_processes` in postgresql.conf to be large enough.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpostgrespro%2Flsm3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpostgrespro%2Flsm3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpostgrespro%2Flsm3/lists"}