Yes, you're right ! The process checks if all these tables exist before creating them. So it might be the SELECT that takes time. To check existence, I use the following query : select * from pg_tables where tablename='the_table'; May be it's not the best way. And I launch a query per table ! Not good at all.
Thank you all, I will optimize this. Sylvain ----- Mail original ----- > On Sun, Jul 8, 2012 at 11:49 PM, Sylvain CAILLET > <[email protected]> wrote: > > Hi, > > > > Thank you all for your help. > > > > @Jeff : my daemon creates these tables at start time so it doesn't > > do > > anything else at the same time. The CPU is loaded between 20% and > > 25%. > How does it decide which tables to create? Is it querying the > existing tables to figure out what new ones to make? Is the rest of > the time going to IO wait? > Cheers, > Jeff
