Abu,
> I really do not know how to find out what the query is waiting on,
> unlike oracle db provides some of the information through its dynamic
> performance views.
Yeah, we don't have that yet.
> Please help in understanding how I can find out what the system is
> waiting for or why is it taking the query so long.
First guess would be I/O bound. The planner, at least, thinks you're
inserting 2 million records. What kind of disk support do you have?
--
--Josh
Josh Berkus
PostgreSQL @ Sun
San Francisco