Skip to content

Commit

Permalink
Add index to created_at
Browse files Browse the repository at this point in the history
When the `telescope_entries` table gets large, `telescope:prune` will fail miserably, actually bringing an AWS db instance to its knees. This is because `telescope:prune` is using `created_at` in a where clause when there's no index on that column.
  • Loading branch information
keyboardSmasher authored May 5, 2020
1 parent b3a1fef commit a6154dc
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function up()
$table->boolean('should_display_on_index')->default(true);
$table->string('type', 20);
$table->longText('content');
$table->dateTime('created_at')->nullable();
$table->dateTime('created_at')->nullable()->index();

$table->unique('uuid');
$table->index('batch_id');
Expand Down

0 comments on commit a6154dc

Please sign in to comment.