Re: Foreman query optimization
Posted by:
Rick James
Date: November 26, 2015 08:56PM
`logs` is a lot larger than `sources`, so there must be a lot of duplicate `source_id` values, correct? So, let's dedup to make things smaller and hopefully faster:
CREATE TEMPORARY TABLE t (
PRIMARY KEY (source_id)
)
SELECT DISTINCT source_id FROM logs;
DELETE
FROM from sources as s
left join t on s.id = t.source_id
where t.source_id is NULL;
Subject
Views
Written By
Posted
1848
November 05, 2015 04:15PM
778
November 05, 2015 05:42PM
796
November 05, 2015 06:54PM
725
November 05, 2015 11:19PM
820
November 06, 2015 11:58AM
739
November 06, 2015 12:35PM
718
November 06, 2015 06:44PM
Re: Foreman query optimization
815
November 26, 2015 08:56PM
Sorry, you can't reply to this topic. It has been closed.
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.