Re: [ADMIN] delete to slow

2005-04-23 Thread Tom Lane
"Spiegelberg, Greg" <[EMAIL PROTECTED]> writes: > Would it be possible to perform a DELETE FROM table WHERE CURRENT OF mycursor? > Is this implemented in Postgres? I'm not seeing in in the manual for 7.4 or > 8. It is (or at least ought to be) on the TODO list, but it's not done yet and I don't

Re: [ADMIN] delete to slow

2005-04-21 Thread Spiegelberg, Greg
Wolff III Sent: Wednesday, April 06, 2005 1:32 PM To: Ricardo Valença de Assis Cc: pgsql-admin@postgresql.org Subject: Re: [ADMIN] delete to slow On Wed, Apr 06, 2005 at 13:45:13 -0300, Ricardo Valença de Assis <[EMAIL PROTECTED]> wrote: > Hello Everybody! > > I´m trying to

Re: [ADMIN] delete to slow

2005-04-06 Thread Jim C. Nasby
On Wed, Apr 06, 2005 at 06:28:26PM -0400, Tom Lane wrote: > It's too big a change to consider back-patching into 8.0, unfortunately. I'll happily settle for 8.1 over nothing... :) -- Jim C. Nasby, Database Consultant [EMAIL PROTECTED] Give your computer some brain candy! www.distri

Re: [ADMIN] delete to slow

2005-04-06 Thread Tom Lane
"Jim C. Nasby" <[EMAIL PROTECTED]> writes: > Hmm... it would be pretty handy if there was a way to make triggers show > up in explain somehow, maybe as a pseudo query node. Been there, done that ... 2005-03-25 16:57 tgl * doc/src/sgml/perform.sgml, src/backend/catalog/pg_constraint.c,

Re: [ADMIN] delete to slow

2005-04-06 Thread Jim C. Nasby
Are you going to do an explain analyze at some point? -- Jim C. Nasby, Database Consultant [EMAIL PROTECTED] Give your computer some brain candy! www.distributed.net Team #1828 Windows: "Where do you want to go today?" Linux: "Where do you want to go tomorrow?" FreeBSD: "Are you g

Re: [ADMIN] delete to slow

2005-04-06 Thread Jim C. Nasby
On Wed, Apr 06, 2005 at 02:15:39PM -0400, Tom Lane wrote: > "Jim C. Nasby" <[EMAIL PROTECTED]> writes: > > Well, neither of those should take very long at all. What's EXPLAIN > > ANALYZE show? > > Indeed ... now I'm wondering about foreign key checks. Are there any > tables with foreign keys link

Re: [ADMIN] delete to slow

2005-04-06 Thread Ricardo Valença de Assis
Yes. I saw. Thanks. But the both explanations takes a lot of time. - Original Message - From: "Bruno Wolff III" <[EMAIL PROTECTED]> To: "Ricardo Valença de Assis" <[EMAIL PROTECTED]> Cc: "Tom Lane" <[EMAIL PROTECTED]>; Sent: Wednesday, April 06, 2005 3:51 PM Subject: Re: delete to slow

Re: [ADMIN] delete to slow

2005-04-06 Thread Bruno Wolff III
On Wed, Apr 06, 2005 at 15:23:57 -0300, Ricardo Valença de Assis <[EMAIL PROTECTED]> wrote: > My question was: Can I use INNER JOIN with DELETE? If yes how? I gave you an example of how. ---(end of broadcast)--- TIP 9: the planner will ignore your

Re: [ADMIN] delete to slow

2005-04-06 Thread Ricardo Valença de Assis
My question was: Can I use INNER JOIN with DELETE? If yes how? - Original Message - From: "Tom Lane" <[EMAIL PROTECTED]> To: "Ricardo Valença de Assis" <[EMAIL PROTECTED]> Cc: "Bruno Wolff III" <[EMAIL PROTECTED]>; Sent: Wednesday, April

Re: [ADMIN] delete to slow

2005-04-06 Thread Tom Lane
"Jim C. Nasby" <[EMAIL PROTECTED]> writes: > Well, neither of those should take very long at all. What's EXPLAIN > ANALYZE show? Indeed ... now I'm wondering about foreign key checks. Are there any tables with foreign keys linking to usuario? If so, the problem is likely unindexed foreign key co

Re: [ADMIN] delete to slow

2005-04-06 Thread Jim C. Nasby
On Wed, Apr 06, 2005 at 02:59:18PM -0300, Ricardo Valen?a de Assis wrote: > DATABASE=# explain delete from usuario where > usua_cd_usuario=backup.usua_cd_usuario; > QUERY PLAN > > Hash Join (cost=5.7

Re: [ADMIN] delete to slow

2005-04-06 Thread Ricardo Valença de Assis
de Assis" <[EMAIL PROTECTED]> Cc: "Bruno Wolff III" <[EMAIL PROTECTED]>; Sent: Wednesday, April 06, 2005 2:56 PM Subject: Re: [ADMIN] delete to slow > On Wed, Apr 06, 2005 at 02:32:55PM -0300, Ricardo Valen?a de Assis wrote: > > I?ve tried... It takes the same t

Re: [ADMIN] delete to slow

2005-04-06 Thread Tom Lane
=?iso-8859-1?Q?Ricardo_Valen=E7a_de_Assis?= <[EMAIL PROTECTED]> writes: > I´ve tried... It takes the same time. I used explain and I saw it... Exactly > the same time. Uh ... what I was asking for was for you to *show* us the EXPLAIN output. You didn't answer the question about PG version either.

Re: [ADMIN] delete to slow

2005-04-06 Thread Jim C. Nasby
On Wed, Apr 06, 2005 at 02:32:55PM -0300, Ricardo Valen?a de Assis wrote: > I?ve tried... It takes the same time. I used explain and I saw it... Exactly > the same time. And what does explain show? Are statistics up to date? -- Jim C. Nasby, Database Consultant [EMAIL PROTECTED] Gi

Re: [ADMIN] delete to slow

2005-04-06 Thread Ricardo Valença de Assis
I´ve tried... It takes the same time. I used explain and I saw it... Exactly the same time. - Original Message - From: "Bruno Wolff III" <[EMAIL PROTECTED]> To: "Ricardo Valença de Assis" <[EMAIL PROTECTED]> Cc: Sent: Wednesday, April 06, 2005 2:31 PM Subject: Re: delete to slow > On We

Re: [ADMIN] delete to slow

2005-04-06 Thread Tom Lane
=?iso-8859-1?Q?Ricardo_Valen=E7a_de_Assis?= <[EMAIL PROTECTED]> writes: > DELETE FROM table1 WHERE column1 IN (SELECT column2 FROM table2); What PG version is this, and what does EXPLAIN say about that query? > Is there a way to use DELETE with INNER JOIN in PostGreSQL? You could do "DEL

Re: [ADMIN] delete to slow

2005-04-06 Thread Bruno Wolff III
On Wed, Apr 06, 2005 at 13:45:13 -0300, Ricardo Valença de Assis <[EMAIL PROTECTED]> wrote: > Hello Everybody! > > I´m trying to use delete to remove data from one table based on another. > The query is this: > > DELETE FROM table1 WHERE column1 IN (SELECT column2 FROM table2); > >

[ADMIN] delete to slow

2005-04-06 Thread Ricardo Valença de Assis
Hello Everybody!       I´m trying to use delete to remove data from one table based on another. The query is this:       DELETE FROM table1 WHERE column1 IN (SELECT column2 FROM table2);       but my table is big, so it takes a lot o time...     Is there a way to use DELETE with INNER JOIN i