Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • B benchPlatform
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Terraform modules
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OnGres Inc.OnGres Inc.
  • benchPlatform
  • Wiki
  • Querys for Mongo and Postgres OLAP bench

Querys for Mongo and Postgres OLAP bench · Changes

Page history
Update Querys for Mongo and Postgres OLAP bench authored Apr 15, 2019 by Sergio Ostapowicz's avatar Sergio Ostapowicz
Hide whitespace changes
Inline Side-by-side
Querys-for-Mongo-and-Postgres-OLAP-bench.md
View page @ 47b0f696
...@@ -58,4 +58,86 @@ FROM github.events AS events ...@@ -58,4 +58,86 @@ FROM github.events AS events
WHERE events.type_s = 'PushEvent' AND payload.size_i > 2 WHERE events.type_s = 'PushEvent' AND payload.size_i > 2
GROUP BY repo.name_s GROUP BY repo.name_s
ORDER BY avg DESC; ORDER BY avg DESC;
```
## MongoDB
### Stampede-GithubQuery-MongoDB-A
```
db.events.aggregate(
[
{ $match: {
$and: [ { type: "IssuesEvent"} , { "payload.action" : "opened" } ] }
},
{ $group: { _id: "$repo.name", total: { $sum: 1 } } },
{ $sort: { total: -1 } }
],
{ allowDiskUse: true, cursor: { batchSize: 100000000 } }
);
```
### Stampede-GithubQuery-MongoDB-B
```
db.events.aggregate(
[
{ $group: { _id: "$type", total: { $sum: 1 } } },
{ $sort: { total: 1 } }
],
{ allowDiskUse: true, cursor: { batchSize: 100000000 } }
);
```
### Stampede-GithubQuery-MongoDB-C
```
db.events.aggregate(
[
{ $group: { _id: "$type", total: { $sum: 1 } } },
{ $sort: { total: -1 } }
],
{ allowDiskUse: true, cursor: { batchSize: 100000000 } }
);
```
### Stampede-GithubQuery-MongoDB-D
```
db.events.aggregate(
[
{ $match: { "payload.action": { $exists: true } } },
{ $group: { _id: "$payload.action", total: { $sum: 1 } } },
{ $sort: { total: 1 } }
],
{ allowDiskUse: true, cursor: { batchSize: 100000000 } }
);
```
### Stampede-GithubQuery-MongoDB-E
```
db.events.aggregate(
[
{ $match: { "type": "PushEvent" } },
{ $project: { "repo.name": 1, "actor.login": 1 } },
{ $group:
{
_id: "$repo.name",
actor: { $first: "$actor.login"},
count: { $sum: 1 }
}
},
{ $group:
{
_id: "$_id",
count: { $sum: 1 }
}
},
{ $sort: { count: -1 } }
],
{ allowDiskUse: true, cursor: { batchSize: 100000000 } }
);
```
### Stampede-GithubQuery-MongoDB-F
```
db.events.aggregate(
[
{ $match: { "type": "PushEvent", "payload.size": { $gt : 2 } } },
{ $group: { _id: "$repo.name", avg: { $avg: "$payload.size" } } },
{ $sort: { avg: -1 } }
],
{ allowDiskUse: true, cursor: { batchSize: 100000000 } }
);
``` ```
\ No newline at end of file
Clone repository
  • Benchmark Track
  • Configuration for all tests
  • Querys for Mongo and Postgres OLAP bench
  • Results Analysis
  • Tooling
  • Home