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
1973
November 05, 2015 04:15PM
844
November 05, 2015 05:42PM
868
November 05, 2015 06:54PM
798
November 05, 2015 11:19PM
892
November 06, 2015 11:58AM
811
November 06, 2015 12:35PM
785
November 06, 2015 06:44PM
Re: Foreman query optimization
878
November 26, 2015 08:56PM
Sorry, you can't reply to this topic. It has been closed.
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.