{"id":16390738,"url":"https://github.com/mikeheddes/fast-multi-join-sketch","last_synced_at":"2025-10-26T13:31:49.237Z","repository":{"id":177041361,"uuid":"659411983","full_name":"mikeheddes/fast-multi-join-sketch","owner":"mikeheddes","description":"Fast Cardinality Estimation of Multi-Join Queries Using Sketches","archived":false,"fork":false,"pushed_at":"2024-02-29T21:26:05.000Z","size":24148,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-28T05:17:59.513Z","etag":null,"topics":["cardinality-estimation","sketching-algorithm"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2402.15953","language":"Python","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/mikeheddes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-06-27T19:25:16.000Z","updated_at":"2024-03-27T17:12:28.000Z","dependencies_parsed_at":"2024-02-29T22:44:53.402Z","dependency_job_id":null,"html_url":"https://github.com/mikeheddes/fast-multi-join-sketch","commit_stats":null,"previous_names":["mikeheddes/fast-multi-join-sketch"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeheddes%2Ffast-multi-join-sketch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeheddes%2Ffast-multi-join-sketch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeheddes%2Ffast-multi-join-sketch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeheddes%2Ffast-multi-join-sketch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikeheddes","download_url":"https://codeload.github.com/mikeheddes/fast-multi-join-sketch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219862866,"owners_count":16555951,"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":["cardinality-estimation","sketching-algorithm"],"created_at":"2024-10-11T04:44:05.603Z","updated_at":"2025-10-26T13:31:42.414Z","avatar_url":"https://github.com/mikeheddes.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\nSoftware License\nCommercial reservation\n\nThis License governs use of the accompanying Software, and your use of the Software constitutes acceptance of this license.\n\nYou may use this Software for any non-commercial purpose, subject to the restrictions in this license. Some purposes which can be non-commercial are teaching, academic research, and personal experimentation. \n\nYou may not use or distribute this Software or any derivative works in any form for any commercial purpose. Examples of commercial purposes would be running business operations, licensing, leasing, or selling the Software, or distributing the Software for use with commercial products. \n\nYou may modify this Software and distribute the modified Software for non-commercial purposes; however, you may not grant rights to the Software or derivative works that are broader than those provided by this License. For example, you may not distribute modifications of the Software under terms that would permit commercial use, or under terms that purport to require the Software or derivative works to be sublicensed to others.\n\nYou agree:\n\n1. Not remove any copyright or other notices from the Software.\n\n2. That if you distribute the Software in source or object form, you will include a verbatim copy of this license.\n\n3. That if you distribute derivative works of the Software in source code form you do so only under a license that includes all of the provisions of this License, and if you distribute derivative works of the Software solely in object form you do so only under a license that complies with this License.\n\n4. That if you have modified the Software or created derivative works, and distribute such modifications or derivative works, you will cause the modified files to carry prominent notices so that recipients know that they are not receiving the original Software. Such notices must state: (i) that you have changed the Software; and (ii) the date of any changes.\n\n5. THAT THIS PRODUCT IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. YOU MUST PASS THIS LIMITATION OF LIABILITY ON WHENEVER YOU DISTRIBUTE THE SOFTWARE OR DERIVATIVE WORKS.\n\n6. That if you sue anyone over patents that you think may apply to the Software or anyone's use of the Software, your license to the Software ends automatically.\n\n7. That your rights under the License end automatically if you breach it in any way.\n\n8. UC Irvine and The Regents of the University of California reserves all rights not expressly granted to you in this license.\n\nTo obtain a commercial license to this software, please contact:\nUCI Beall Applied Innovation\nAttn: Director, Research Translation Group\n5270 California Ave, Suite 100\nIrvine, CA 92697\nWebsite: innovation.uci.edu\nPhone: 949-824-COVE (2683) \nEmail: cove@uci.edu\n\nStandard BSD License\n\n\u003cOWNER\u003e = The Regents of the University of California\n\u003cORGANIZATION\u003e = University of California, Irvine\n\u003cYEAR\u003e = 2020\n\nCopyright (c) \u003c2020\u003e, The Regents of the University of California\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\n3. Neither the name of The Regents of the University of California or the University of California, Irvine, nor the names of its contributors, may be used to endorse or promote products derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n--\u003e\n# Convolution and Cross-Correlation of Count Sketches Enables Fast Cardinality Estimation of Multi-Join Queries\n\nThis repository contains the source code, extended results, and cardinality estimates for the experiments of the research paper published at the International Conference on Management of Data (SIGMOD) 2024.\n\n## Requirements\n\nThe code is written in Python 3.10. The required packages to run the experiments can be found in `requirements.txt`. To install the required packages, run the following command:\n\n```bash\npip install -r requirements.txt\n```\n\nIn addition, the hash function needs to be compiled by following the directions in `/kwisehash/README.md`.\n\n\n### Download the data and queries\n\nThe experiments use the IMDB and STATS databases with queries provided by the [End-to-End CardEst Benchmark](https://github.com/Nathaniel-Han/End-to-End-CardEst-Benchmark). To run the experiments, first download the required data using the following commands:\n\n```bash\ncurl -L -o End-to-End-CardEst-Benchmark.zip https://github.com/Nathaniel-Han/End-to-End-CardEst-Benchmark/archive/refs/heads/master.zip\nunzip End-to-End-CardEst-Benchmark.zip\nrm End-to-End-CardEst-Benchmark.zip\n\ncurl -L -o imdb.tgz http://homepages.cwi.nl/~boncz/job/imdb.tgz\nmkdir imdb\ntar zxvf imdb.tgz -C imdb\nrm imdb.tgz\n```\nThis should result in the following file structure:\n```\nEnd-to-End-CardEst-Benchmark-master/\nimdb/\nexperiment.py\n...\n```\n\n## Experiments\n\nInformation about the accepted arguments for the experiments can be obtained using the following command:\n\n```bash\npython experiment.py --help\n```\n\nFor example, the following command runs our proposed method with `m=1000000` and takes the median of `l=5` i.i.d. estimates:\n\n```bash\npython experiment.py --method count-conv --query stats-7 --bins 1000000 --medians 5\n```\n\n### Available queries\n\nThe [End-to-End CardEst Benchmark](https://github.com/Nathaniel-Han/End-to-End-CardEst-Benchmark) provides queries with sub-queries for the STATS and IMDB databases. The following are the available options: `stats-[1-146]`, `stats_sub-[1-2603]`, `job_light-[1-70]`, and `job_light_sub-[1-696]`, where the brackets are inclusive ranges.\n\n\n### Speed-up data loading\n\nLoading the data from csv files for each experiment can incur significant overhead. To alleviate this, one can cache the loaded tables as pickle files using `python cache_tables.py`. After this finishes, the data loading time during the experiments should be reduced by roughly a factor of 10.\n\n\n## Extended results\n\nThe absolute relative error plots, in addition to the timing plots of each stage (initialization, sketching, and inference) for all 216 queries are provided in [`/figures`](figures).\n\n\n## Cardinality estimates\n\nThe cardinality estimates for all the sub-queries of both the STATS and IMDB databases are provided in [`/estimates`](estimates), which follows the same format as the estimates provided by the [End-to-End CardEst Benchmark](https://github.com/Nathaniel-Han/End-to-End-CardEst-Benchmark).\n\n\n## Citation\n\nIf you use this code for your research, please cite our paper:\n\n```\n@inproceedings{heddes2024convolution,\n  title={Convolution and Cross-Correlation of Count Sketches Enables Fast Cardinality Estimation of Multi-Join Queries},\n  author={Heddes, Mike and Nunes, Igor and Givargis, Tony and Nicolau, Alex},\n  booktitle={Proceedings of the 2024 ACM SIGMOD International Conference on Management of Data},\n  year={2024}\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikeheddes%2Ffast-multi-join-sketch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikeheddes%2Ffast-multi-join-sketch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikeheddes%2Ffast-multi-join-sketch/lists"}