Add cartesian and hash join mgbench (#1393)

This commit is contained in:
Josipmrden 2023-10-24 19:44:11 +02:00 committed by GitHub
parent 4e8148f7d9
commit fdf63436ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 55 additions and 0 deletions

View File

@ -73,6 +73,8 @@ jobs:
./benchmark.py vendor-native --num-workers-for-benchmark 1 --export-results benchmark_high_write_set_property.json high_write_set_property
./benchmark.py vendor-native --num-workers-for-benchmark 12 --export-results cartesian.json cartesian
- name: Upload mgbench results
run: |
cd tools/bench-graph-client
@ -96,3 +98,9 @@ jobs:
--github-run-id "${{ github.run_id }}" \
--github-run-number "${{ github.run_number }}" \
--head-branch-name "${{ env.BRANCH_NAME }}"
./main.py --benchmark-name "cartesian" \
--benchmark-results-path "../../tests/mgbench/cartesian.json" \
--github-run-id "${{ github.run_id }}" \
--github-run-number "${{ github.run_number }}" \
--head-branch-name "${{ env.BRANCH_NAME }}"

View File

@ -52,6 +52,8 @@ jobs:
./benchmark.py vendor-native --num-workers-for-benchmark 1 --export-results benchmark_high_write_set_property.json high_write_set_property
./benchmark.py vendor-native --num-workers-for-benchmark 12 --export-results benchmark_cartesian.json cartesian
- name: Upload benchmark results
run: |
cd tools/bench-graph-client
@ -75,3 +77,9 @@ jobs:
--github-run-id "${{ github.run_id }}" \
--github-run-number "${{ github.run_number }}" \
--head-branch-name "${{ env.BRANCH_NAME }}"
./main.py --benchmark-name "cartesian" \
--benchmark-results-path "../../tests/mgbench/cartesian.json" \
--github-run-id "${{ github.run_id }}" \
--github-run-number "${{ github.run_number }}" \
--head-branch-name "${{ env.BRANCH_NAME }}"

View File

@ -0,0 +1,39 @@
# Copyright 2023 Memgraph Ltd.
#
# Use of this software is governed by the Business Source License
# included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source
# License, and you may not use this file except in compliance with the Business Source License.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software will be governed
# by the Apache License, Version 2.0, included in the file
# licenses/APL.txt.
from workloads.base import Workload
class Supernode(Workload):
NAME = "cartesian"
CARDINALITY = 1000
def indexes_generator(self):
return [
("CREATE INDEX ON :Node;", {}),
("CREATE INDEX ON :Node(id);", {}),
]
def dataset_generator(self):
queries = []
for i in range(0, Supernode.CARDINALITY):
queries.append(("CREATE (:Node {id: $id, id2: $id});", {"id": i, "id2": i}))
return queries
def benchmark__test__plain_cartesian_filtering(self):
return ("MATCH (n1:Node), (n2:Node) WHERE n1.id < 100 and n2.id < 100 RETURN n1, n2;", {})
def benchmark__test__plain_cartesian_join(self):
return ("MATCH (n1:Node), (n2:Node) WHERE n1.id = n2.id RETURN n1, n2;", {})
def benchmark__test__plain_cartesian_different_props_join(self):
return ("MATCH (n1:Node), (n2:Node) WHERE n1.id = n2.id2 RETURN n1, n2;", {})