1
0
mirror of https://github.com/flarum/core.git synced 2025-07-31 13:40:20 +02:00

perf(statistics): rewrite for performance on very large communities (#3531)

Co-authored-by: Sami Mazouz <ilyasmazouz@gmail.com>
This commit is contained in:
David Wheatley
2022-07-18 19:07:38 +01:00
committed by GitHub
parent 6dde236d77
commit af3116bce9
13 changed files with 707 additions and 309 deletions

View File

@@ -0,0 +1,25 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;
return [
'up' => function (Builder $schema) {
$schema->table('posts', function (Blueprint $table) {
$table->index('type');
});
},
'down' => function (Builder $schema) {
$schema->table('posts', function (Blueprint $table) {
$table->dropIndex(['type']);
});
}
];

View File

@@ -0,0 +1,25 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;
return [
'up' => function (Builder $schema) {
$schema->table('posts', function (Blueprint $table) {
$table->index(['type', 'created_at']);
});
},
'down' => function (Builder $schema) {
$schema->table('posts', function (Blueprint $table) {
$table->index(['type', 'created_at']);
});
}
];