Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions api/v1_users_feed.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ func (app *ApiServer) v1UsersFeed(c *fiber.Ctx) error {
SELECT
'track' as entity_type,
track_id as entity_id,
created_at
GREATEST(tracks.created_at, COALESCE(tracks.release_date, tracks.created_at)) as created_at
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will break our cache on the client because we will have different values for created_at across the same track

from tracks
join follow_set on owner_id = user_id
where @filter in ('all', 'original')
AND created_at < @before
AND created_at >= @before::timestamp - INTERVAL '1 YEAR'
AND GREATEST(tracks.created_at, COALESCE(tracks.release_date, tracks.created_at)) < @before
AND GREATEST(tracks.created_at, COALESCE(tracks.release_date, tracks.created_at)) >= @before::timestamp - INTERVAL '1 YEAR'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

concerned abt query performance, can you play with the query planning for an account like mine?

AND is_unlisted = false
AND is_delete = false
AND stem_of is null
Expand Down