{"id":46851580,"url":"https://github.com/cwida/ivm-extension","last_synced_at":"2026-03-10T16:36:00.333Z","repository":{"id":173069932,"uuid":"650198737","full_name":"cwida/ivm-extension","owner":"cwida","description":"Incremental View Maintenance support for DuckDB","archived":false,"fork":false,"pushed_at":"2023-10-24T11:24:17.000Z","size":451,"stargazers_count":12,"open_issues_count":5,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-10T07:41:05.872Z","etag":null,"topics":["database","duckdb","extension","incremental-computation","incremental-view-maintenance"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cwida.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-06-06T14:53:04.000Z","updated_at":"2025-08-11T03:40:27.000Z","dependencies_parsed_at":"2024-01-30T17:05:00.007Z","dependency_job_id":null,"html_url":"https://github.com/cwida/ivm-extension","commit_stats":null,"previous_names":["cwida/ivm-extension"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cwida/ivm-extension","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwida%2Fivm-extension","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwida%2Fivm-extension/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwida%2Fivm-extension/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwida%2Fivm-extension/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cwida","download_url":"https://codeload.github.com/cwida/ivm-extension/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwida%2Fivm-extension/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30342194,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T15:55:29.454Z","status":"ssl_error","status_checked_at":"2026-03-10T15:54:58.440Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["database","duckdb","extension","incremental-computation","incremental-view-maintenance"],"created_at":"2026-03-10T16:35:59.629Z","updated_at":"2026-03-10T16:36:00.322Z","avatar_url":"https://github.com/cwida.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ivm-extension\n\nIncrementally maintain view `result` using query `PRAGMA ivm_upsert('catalog', 'schema', 'result')`;\n\nRead more [here](https://github.com/cwida/ivm-extension/blob/ivm-optimizer-rule/VLDB%20Summer%20School%202023%20Poster.pdf)\n\n## Usage\nGiven a base table `hello` and a view `result` on top of `hello`, this extension incrementally computes the changes to the view `result` when the underlying table `hello` changes. \n\nThis extension assumes that changes to base table `hello` are present in delta table `delta_hello`. This table additionally has a multiplicity column `_duckdb_ivm_multiplicity` of type `BOOL`. `duckdb_ivm_multiplicity=true` means insertions and `duckdb_ivm_multiplicity` means deletion. Updates to a row in base table `hello` are modelled as deletion+insertion.\n\nFirst create the base table and the view:\n```SQL\nCREATE TABLE hello(a INTEGER, b INTEGER , c VARCHAR);\nCREATE VIEW result AS (SELECT sum(a), count(c), b FROM hello GROUP BY b);\n```\n\nCreate `delta_hello`:\n```SQL\nCREATE TABLE delta_hello AS (SELECT * FROM hello LIMIT 0);\nALTER TABLE delta_hello ADD COLUMN _duckdb_ivm_multiplicity BOOL;\nINSERT INTO delta_hello VALUES (1,1, 'Mark',true), (2,2, 'Hannes',false), (3,1, 'Kriti',true), (4,1, 'Peter',false);\n```\n**NOTE**: The extension assumes the presence of the delta base table `delta_hello`.\n\n### Incrementally maintaining view *result*\nRun the extension as\n```SQL\nPRAGMA ivm_upsert('memory', 'main','result');\n```\nThe output of the above will be the table `delta_result`, which will contain incremental processing of the changes to the base table of view `result`. \n\n### Extent of SQL Support\n* Only SELECT, FILTER, GROUP BY, PROJECTION\n* Aggregations supported: SUM, COUNT\n* Joins, nested-subqueries and other SQL clauses like HAVING **not supported**.\n\n### Known issues\nIVM on queries in which the base table returns no data because of a `WHERE` clause, **will fail**. So, while using `WHERE`, always ensure that the base table returns a non-empty result. More details in [this issue](https://github.com/cwida/ivm-extension/issues/10).\n\n## Building the Extension\n* Download the files in the repo into folder `duckdb_project_root/extension/ivm`\n* Search for `JSON_EXTENSION` and make similar changes for `IVM_EXTENSION`\n* Build the `duckdb` binary using `make`. The IVM extension will be included in the binary\n* Enable debug mode in extension using `make debug`\n\n## Running Tests\n* The tests are present in `project_root/tests`. \n* Create a folder `duckdb_project_root/test/ivm`.\n* Copy the test files into the above folder.\n* Use the `unittest` executable and provide name of the test as program argument\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcwida%2Fivm-extension","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcwida%2Fivm-extension","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcwida%2Fivm-extension/lists"}