On Tue, Sep 2, 2008 at 10:58 AM, Tom Lane <[EMAIL PROTECTED]> wrote:
> "Richard Broersma" <[EMAIL PROTECTED]> writes:
>> There is one possible alteration that may or many not improve
>> performance. This would be to replace the EXISTS with a LEFT JOIN
>> WHERE IS NOT NULL;
>
> That changes the beh
Tom Lane wrote:
"Richard Broersma" <[EMAIL PROTECTED]> writes:
There is one possible alteration that may or many not improve
performance. This would be to replace the EXISTS with a LEFT JOIN
WHERE IS NOT NULL;
That changes the behavior, doesn't it? Or is event_log_no a unique
key for Myeve
"Richard Broersma" <[EMAIL PROTECTED]> writes:
> There is one possible alteration that may or many not improve
> performance. This would be to replace the EXISTS with a LEFT JOIN
> WHERE IS NOT NULL;
That changes the behavior, doesn't it? Or is event_log_no a unique
key for Myevents? I think wh
Richard Broersma wrote:
On Tue, Sep 2, 2008 at 9:47 AM, Steve Clark <[EMAIL PROTECTED]> wrote:
srm2=# explain
srm2-# INSERT INTO Myevents
srm2-# SELECT *
ERROR: INSERT has more expressions than target columns
srm2=# explain
srm2-# INSERT INTO Myevents
srm2-# SELECT *
ERROR:
On Tue, Sep 2, 2008 at 9:47 AM, Steve Clark <[EMAIL PROTECTED]> wrote:
> srm2=# explain
> srm2-# INSERT INTO Myevents
> srm2-# SELECT *
> ERROR: INSERT has more expressions than target columns
> srm2=# explain
> srm2-# INSERT INTO Myevents
> srm2-# SELECT *
> ERROR: INSERT has more ex
Richard Broersma wrote:
On Tue, Sep 2, 2008 at 8:10 AM, Steve Clark <[EMAIL PROTECTED]> wrote:
Is there a way to do something similar with the following? I am an SQL noob
and the
following takes longer to run than is reasonable, on the order of hours.
insert into myevents select * from t_unit
On Tue, Sep 2, 2008 at 8:10 AM, Steve Clark <[EMAIL PROTECTED]> wrote:
> Is there a way to do something similar with the following? I am an SQL noob
> and the
> following takes longer to run than is reasonable, on the order of hours.
>
> insert into myevents select * from t_unit_event_log a where
Richard Broersma wrote:
On Tue, Sep 2, 2008 at 4:19 AM, Ivan Sergio Borgonovo
<[EMAIL PROTECTED]> wrote:
insert into d (pk, c1, c2, ...) select pk, c1, c2, c3 from s
where s.pk not in (select pk from d);
This insert statement might be faster:
INSERT INTO d (pk, c1, c2, ... )
SELECT pk, c1
On Tue, Sep 2, 2008 at 4:19 AM, Ivan Sergio Borgonovo
<[EMAIL PROTECTED]> wrote:
> insert into d (pk, c1, c2, ...) select pk, c1, c2, c3 from s
> where s.pk not in (select pk from d);
This insert statement might be faster:
INSERT INTO d (pk, c1, c2, ... )
SELECT pk, c1, c2, ...
FROM s
LEFT J
Ivan Sergio Borgonovo <[EMAIL PROTECTED]> writes:
> I need to merge 2 tables:
>
> update d set c1=s.c1, c2=s.c2... from s where d.pk=s.pk;
> insert into d (pk, c1, c2, ...) select pk, c1, c2, c3 from s
> where s.pk not in (select pk from d);
you could try making the not in an exists. In release
10 matches
Mail list logo