Search Postgresql Archives

Seeing foreign key lookups in explain output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi list,

an explain analyze wish :

create table t1(id serial primary key);
create table t2(id serial primary key,
                ref integer references t1(id) on delete cascade);
...insert many rows in both tables...
explain delete from t1 where id < 10000;
...
The explain output will tell me it's using the index on t1's id, but it tells 
me nothing about the seqscan that happens on t2 (because I forgot to add an 
index on t2.ref).

It isn't the first time I get bitten by this, and I bet I'm not the only one. 
The explain tells me everything will work fast, but reallity is 100 times 
slower. Is there a way I can extend explain output to show the rest of the 
work done behind the scene ? Fixing that performance issue is easy once you 
see it, but most people will just look at the explain output and erroneously 
conclude "it's as good as it gets".

-- 
Vincent de Phily

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux