[pgsql-jp: 37457] Re: SQLの実行速度について

Ryousuke Wayama wayama7 @ bb.excite.co.jp
2006年 8月 22日 (火) 17:47:52 JST


和山です。
結果が出ないのはちょっとわかりませんが、
私の環境は8.1でしたのでMAX関数でINDEXが使われていますが、
それ以前ではINDEXは使用されません。
失礼しました。

http://www.postgresql.jp/document/pg810doc/html/release.html

ですので、以下のように書き換える必用があります。

select *
from shouhin as a,history as b
where a.no=b.id and b.no = (select c.no from history c
 where c.id=a.no order by no desc limit 1);



pgsql-jp メーリングリストの案内