Don't ignore arch in fedmsg deduplication
ClosedPublic

Authored by mkrizek on Dec 16 2015, 6:23 PM.

Diff Detail

Repository
rRSDB resultsdb
Branch
feature/fix-dedup-arch
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 399
Build 399: arc lint + arc unit
mkrizek retitled this revision from to Don't ignore arch in fedmsg deduplication.Dec 16 2015, 6:23 PM
mkrizek updated this object.
mkrizek edited the test plan for this revision. (Show Details)
mkrizek added reviewers: tflink, kparal, jskladan.
tflink requested changes to this revision.Dec 17 2015, 7:22 AM

This should have some unit tests with it. I'd also like to see this done with fewer joins, if possible

This revision now requires changes to proceed.Dec 17 2015, 7:22 AM
resultsdb/controllers/api_v1.py
644
In D698#13337, @tflink wrote:

... I'd also like to see this done with fewer joins, if possible

Since multiple joins on the same table create query like this:

SELECT result.id AS result_id FROM result 
      JOIN resultdata AS resultdata_1 ON result.id = resultdata_1.result_id
      JOIN resultdata AS resultdata_2 ON result.id = resultdata_2.result_id 
WHERE
      resultdata_1.key = :key_1 AND resultdata_1.value = :value_1 
      AND
      resultdata_2.key = :key_2 AND resultdata_2.value = :value_2

I doubt that it could be done in less of them. It could be replaced by nested SELECT, but from what I've read on the PostgreSQL planner, it is better with JOINs. Would be worth a try, though.

mkrizek updated this revision to Diff 1832.Jan 7 2016, 2:23 PM
  • Add unittests
jskladan accepted this revision.Jan 12 2016, 12:47 PM
tflink accepted this revision.Jan 12 2016, 4:45 PM
This revision is now accepted and ready to land.Jan 12 2016, 4:45 PM
mkrizek closed this revision.Jan 13 2016, 8:46 AM