Landscape トップページ | < 前の月 2002-10 2002-11 次の月 2002-12 >

Landscape - エンジニアのメモ 2002-11

月ごとの記事一覧
2007年: 1月 2月 3月 4月 5月 6月 7月 8月 9月 10月 11月 12月
2006年: 1月 2月 3月 4月 5月 6月 7月 8月 9月 10月 11月 12月
2005年: 1月 2月 3月 4月 5月 6月 7月 8月 9月 10月 11月 12月
2004年: 1月 2月 3月 4月 5月 6月 7月 8月 9月 10月 11月 12月
2003年: 1月 2月 3月 4月 5月 6月 7月 8月 9月 10月 11月 12月
2002年: 1月 2月 3月 4月 5月 6月 7月 8月 9月 10月 11月 12月
日ごとのページ
2002-11/ 1日 2日 3日 4日 5日 6日 7日 8日 9日 10日 11日 12日 13日 14日 15日 16日 17日 18日 19日 20日 21日 22日 23日 24日 25日 26日 27日 28日 29日 30日

2002-11-26 (Tue)

* Postgres の timestamp 型

この記事の直リンクURL: Permlink | この記事が属するカテゴリ: [Postgres]

postgres 7.3 からは、timestamp 型のタイムゾーンの扱いが変わるようだ。
[pgsql-jp: 28083] Re: timestamp型の
http://ml.postgresql.jp/pipermail/pgsql-jp/2002-November/003 ...
> pg_dump dbname > db.out でバックアップファイルを作成
>
> db.outをviにて置き換え。
> :%s/timestamp wuthout time zone/timestamp(0) with time zone/g

参考までにもう一つ。
7.2では単にtimestampといえ(記述すれ)ばtimestamp with time zone
でしたが、7.3からはtimestamp without time zoneになります。これから
はwith/withoutを明記しないと混乱してしまうでしょうね。


2002-11-18 (Mon)

* SQL の NATURAL LEFT OUTER JOIN 文

この記事の直リンクURL: Permlink | この記事が属するカテゴリ: [SQL]

- OUTER JOIN するとき、NATURAL を指定すれば、ON 節でカラム名を明示しなくて済む、という事でやってみたのだが、非常に遅い。


カラム名で指定: Total runtime: 1727.18 msec
NATURAL で指定: Total runtime: 3849.53 msec

倍近く遅くなってる。NATURAL だと、どのカラムで JOIN できるかどうかを探索するため遅くなっているのだろうか。以下に EXPLAIN ANALYZE の結果を載せておく。

- カラム名で指定したときの SQL : Total runtime: 1727.18 msec

Unique  (cost=31062.45..31092.26 rows=92 width=260) (actual time=1675.56..1723.79 rows=150 loops=1)
  ->  Sort  (cost=31062.45..31062.45 rows=918 width=260) (actual time=1675.42..1675.88 rows=156 loops=1)
        ->  Merge Join  (cost=30950.59..31017.30 rows=918 width=260) (actual time=442.96..474.64 rows=156 loops=1)
              ->  Index Scan using summary_pkey on summary  (cost=0.00..52.00 rows=1000 width=80) (actual time=0.27..0.27 rows=0 loops=1)
              ->  Sort  (cost=30950.59..30950.59 rows=918 width=180) (actual time=442.35..443.03 rows=156 loops=1)
                    ->  Hash Join  (cost=4.90..30905.44 rows=918 width=180) (actual time=15.61..439.20 rows=156 loops=1)
                          ->  Merge Join  (cost=0.00..30884.49 rows=918 width=123) (actual time=8.90..423.29 rows=156 loops=1)
                                ->  Index Scan using sysqa_pkey on account  (cost=0.00..30826.80 rows=578 width=115) (actual time=7.38..339.52 rows=32 loops=1)
                                      SubPlan
                                        ->  Materialize  (cost=26.48..26.48 rows=8 width=4) (actual time=0.01..0.09 rows=32 loops=1157)
                                              ->  Index Scan using doc_property_system_code on doc_property  (cost=0.00..26.48 rows=8 width=4) (actual time=1.00..3.66 rows=32 loops=1)
                                ->  Index Scan using doc_property_serialnum on doc_property  (cost=0.00..40.19 rows=1835 width=8) (actual time=0.93..61.53 rows=1703 loops=1)
                          ->  Hash  (cost=4.52..4.52 rows=152 width=57) (actual time=6.33..6.33 rows=0 loops=1)
                                ->  Seq Scan on system_name  (cost=0.00..4.52 rows=152 width=57) (actual time=0.33..4.38 rows=152 loops=1)

- NATURAL で指定したときの SQL: Total runtime: 3849.53 msec
Unique  (cost=31070.42..31100.24 rows=92 width=292) (actual time=3800.17..3846.17 rows=150 loops=1)
  ->  Sort  (cost=31070.42..31070.42 rows=918 width=292) (actual time=3800.02..3800.45 rows=156 loops=1)
        ->  Merge Join  (cost=31020.42..31025.27 rows=918 width=292) (actual time=2382.34..2412.63 rows=156 loops=1)
              ->  Sort  (cost=30950.59..30950.59 rows=918 width=180) (actual time=2381.23..2381.78 rows=156 loops=1)
                    ->  Hash Join  (cost=4.90..30905.44 rows=918 width=180) (actual time=15.27..438.47 rows=156 loops=1)
                          ->  Merge Join  (cost=0.00..30884.49 rows=918 width=123) (actual time=8.46..422.62 rows=156 loops=1)
                                ->  Index Scan using sysqa_pkey on account  (cost=0.00..30826.80 rows=578 width=115) (actual time=7.18..339.89 rows=32 loops=1)
                                      SubPlan
                                        ->  Materialize  (cost=26.48..26.48 rows=8 width=4) (actual time=0.01..0.07 rows=32 loops=1157)
                                              ->  Index Scan using doc_property_system_code on doc_property  (cost=0.00..26.48 rows=8 width=4) (actual time=0.81..3.46 rows=32 loops=1)
                                ->  Index Scan using doc_property_serialnum on doc_property  (cost=0.00..40.19 rows=1835 width=8) (actual time=0.72..60.75 rows=1703 loops=1)
                          ->  Hash  (cost=4.52..4.52 rows=152 width=57) (actual time=6.39..6.39 rows=0 loops=1)
                                ->  Seq Scan on system_name  (cost=0.00..4.52 rows=152 width=57) (actual time=0.32..4.41 rows=152 loops=1)
              ->  Sort  (cost=69.83..69.83 rows=1000 width=112) (actual time=0.74..0.74 rows=0 loops=1)
                    ->  Seq Scan on summary  (cost=0.00..20.00 rows=1000 width=112) (actual time=0.02..0.02 rows=0 loops=1)


2002-11-06 (Wed)

* PHP 4.3.0 Beta configure test

この記事の直リンクURL: Permlink | この記事が属するカテゴリ: [PHP]

[PHP-users 11299] に従い、sonic でテストしてみる。
knowhow や pro でテストするならば、
./configure --with-pgsql --enable-track-vars --with-apxs=/usr/local/apache/bin/apxs --enable-versioning --without-gd --enable-trans-sid --enable-mbstring --enable-mbregex --enable-mbstr-enc-trans && time nice -19 make test
というオプションになるが、sonic の apache は OS のデフォルトのままなので、
./configure --with-pgsql --enable-track-vars --with-apxs=/usr/sbin/apxs --enable-versioning --without-gd --enable-trans-sid --enable-mbstring --enable-mbregex --enable-mbstr-enc-trans && time nice -19 make test
となる。

2002-11-01 (Fri)

* my 宣言とレキシカル (lexical) 変数

この記事の直リンクURL: Permlink | この記事が属するカテゴリ: [Perl]

おさらい。my は ブレース { } で囲まれたブロックに、変数のスコープを限定する。ただし、ブロック内で呼び出したサブルーチンはスコープ外。ブロック内で呼び出したサブルーチン内もスコープに入れたければ、local を使う。

以下のコードを実行すると、スコープの外なので何も表示されない。
use strict; すると、$str の所属パッケージ名が必要、というエラーが出る。
#!/usr/bin/perl

&test_func;

sub test_func {
  if (1) {
    my $str = 'Hello World';
  }
  print $str;
}


すべての記事の見出し (全1029件)
全カテゴリの一覧と記事の数
カテゴリごとに記事をまとめ読みできます。記事の表題だけを見たい場合は、すべての記事の見出し (カテゴリ別表示) へ。

直近30日分の記事
2007-04-23 (Mon)
2007-03-07 (Wed)
2007-02-27 (Tue)
2007-01-17 (Wed)
2007-01-15 (Mon)
2007-01-14 (Sun)
2007-01-08 (Mon)
2006-12-01 (Fri)
2006-11-22 (Wed)
2006-11-20 (Mon)
2006-11-19 (Sun)
2006-09-30 (Sat)
2006-08-29 (Tue)
2006-08-04 (Fri)
2006-07-27 (Thu)
2006-07-23 (Sun)
2006-07-17 (Mon)
2006-07-10 (Mon)
2006-07-06 (Thu)
2006-07-03 (Mon)
2006-06-29 (Thu)
2006-06-28 (Wed)
2006-06-27 (Tue)
2006-06-25 (Sun)
2006-06-19 (Mon)
2006-06-18 (Sun)
2006-06-15 (Thu)
2006-06-11 (Sun)
2006-06-01 (Thu)
2006-05-30 (Tue)
プロファイル
斎藤 宏明。エンジニアです。宇都宮市に住んでいます。
リンク
RSS
スポンサードリンク
Powered by
さくらインターネット

© 斎藤 宏明 Saito Hiroaki Gmail Address
Landscape - エンジニアのメモ http://sonic64.com/
Landscape はランドスケープと読みます。
ひらがなだと らんどすけーぷ です。

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy