LoginSignup
1
0

More than 5 years have passed since last update.

AWSとcakephp2とpostgresqlで遅い時の対処

Last updated at Posted at 2018-06-04

AWSでcakephp2とpostgresでアプリケーションを構成した時に、遅かったので原因と対応した内容です。

原因

DBへのアクセスで、カラムの情報を取得している部分の「getColumnMeta」がcolumn数分ループしており、ここが遅かった。

getColumnMetaが遅いので対応

対応している人がいたので、そのまま導入したら解決

php composer.phar require mfn/cakephp2-postgres-no-meta
app/Config/bootstrap.php
CakePlugin::load('PostgresNoMeta');
app/Config/bootstrap.php
    var $default = array(
        'datasource' => 'PostgresNoMeta.Database/PostgresNoMeta',
        'persistent' => false,
        'host' => 'localhost',
        'login' => 'user',
        'password' => 'password',
        'database' => 'hoge',
        'encoding' => 'utf8',
        'prefix' => '',
    );
1
0
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
1
0