8
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Laravelで大量のSQLを発行する場合の注意点

Last updated at Posted at 2015-03-23

Laravelで(バッチ等によって)大量のSQLを発行する場合、
メモリー違反が発生することがあります。

Laravelではデフォルトでメモリにクエリログが記録され、
それがオーバーフローしてしまう場合があるためです。

上記を解決するには(つまりクエリログを記録しないようにするには)、
下記を処理の先頭に記述しておきましょう。


\DB::connection()->disableQueryLog();

8
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?