Re: Query optimize on large database
Yeah, there's a typo in my 1st post query. (group by d1.owner_id must be d2.owner_id)
Ofc, the correct one is:
SELECT d2.owner_id, COUNT(*) AS kolvo
FROM data d1
JOIN data d2 USING(Artist,Title)
WHERE d1.owner_id = @user_id
GROUP BY d2.owner_id
Again - structure is [owner_id, Artist, Title]. More than 100 000 users there.
Requirement is to get number of songs matching the specified user's songlist and group it by other user's with indicating the number of matches.
For example we got @user_id = 123 at the input, so we must get list like
[owner_id , matches]
2: 5
52: 4
74: 2
433: 10
... and so on doing fullscan
Sorry for maybe not so PLAIN english :)
Subject
Views
Written By
Posted
1457
July 13, 2016 01:40AM
864
July 15, 2016 05:12PM
839
July 16, 2016 04:15AM
783
July 16, 2016 12:09PM
866
July 16, 2016 12:36PM
800
July 16, 2016 02:46PM
873
July 17, 2016 11:22AM
Re: Query optimize on large database
833
July 18, 2016 04:28AM
799
July 18, 2016 08:40AM
779
July 20, 2016 04:46AM
850
July 20, 2016 08:06AM
817
July 20, 2016 09:29AM
815
July 21, 2016 04:35AM
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.