<?php $db = pg_connect('dbname=test'); $sql = " CREATE TABLE artist ( artist_id serial primary key, name text not null ) "; pg_query($sql); $sql = " CREATE TABLE music ( music_id serial primary key, artist_id integer not null, title text not null ) "; pg_query($sql); for ($i = 0; $i < 10000; $i++) { $a_name = serialize(time() + $i); $sql = "INSERT INTO artist(name) VALUES('{$a_name}')"; $res = pg_
![PostgreSQLパフォーマンスチューニングのために ~重いSQLの見つけ方~ : アシアルブログ](https://cdn-ak-scissors.b.st-hatena.com/image/square/39e482c008d605a5b5f9180e98756d084baf2b67/height=288;version=1;width=512/https%3A%2F%2Fblog.asial.co.jp%2Fogp-logo.jpg)