32 lines
761 B
PHP
32 lines
761 B
PHP
<?php
|
|
|
|
namespace App\Tasks\MassInsert;
|
|
|
|
use App\Models\Transaction;
|
|
use Carbon\Carbon;
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
class MassInsert1Task
|
|
{
|
|
|
|
/**
|
|
* insert unit
|
|
*
|
|
* 100 ............ 0,166 s DONE
|
|
* 1000 ............ 1,000 s DONE
|
|
* 10000 ........... 13,000 s DONE
|
|
* 100000 .......... 163,000 s DONE
|
|
* 1000000 ..........1506,000 s DONE (25m 6s)
|
|
*
|
|
* 1. insert into transactions (id, value, date) values (1, 10, '2023-04-01');
|
|
* - index, view materialized
|
|
*
|
|
* 2. insert into transactions (id, value, date) values (2, 20, '2023-04-02');
|
|
* - index, view materialized
|
|
*/
|
|
public function handle(int $count): void
|
|
{
|
|
Transaction::factory($count)->create();
|
|
}
|
|
}
|