В Срд, 27.10.2004, в 09:57, TTK Ciar пишет:
> brad=# explain analyse select
ServerDisks.servername,ServerDisks.diskserial,ServerDisks.diskmountpoint,DiskFiles.name,DiskFiles.md5from
DiskFiles,ServerDiskswhere DiskFiles.diskserial=ServerDisks.diskserial;
> QUERY PLAN
> ------------------------------------------------------------------
> Hash Join (cost=22.50..65.00 rows=1000 width=274) (actual time=118.584..124653.729 rows=10133349 loops=1)
> Hash Cond: (("outer".diskserial)::text = ("inner".diskserial)::text)
> -> Seq Scan on diskfiles (cost=0.00..20.00 rows=1000 width=198) (actual time=7.201..31336.063 rows=10133349
loops=1)
> -> Hash (cost=20.00..20.00 rows=1000 width=158) (actual time=90.821..90.821 rows=0 loops=1)
> -> Seq Scan on serverdisks (cost=0.00..20.00 rows=1000 width=158) (actual time=9.985..87.364 rows=2280
loops=1)
> Total runtime: 130944.586 ms
You should run ANALYZE on your database once in a while.
--
Markus Bertheau <twanger@bluetwanger.de>