Is D1 super slow with multiple joins? I have a simple blog schema. I have less than 10k total record

Is D1 super slow with multiple joins? I have a simple blog schema. I have less than 10k total records. This query executes locally with Sqlite under 200ms but is taking about 7 seconds in production. Is there any way to speed this up or do I need to wait until D1 is more mature for these types of queries?
    SELECT
    posts.id,
    posts.title,
    posts.updatedOn,
    substr(posts.body, 0, 20) as body,
    users.firstName || ' ' || users.lastName as author,
    count(comments.id) as commentCount,
    categories.title as category,
    COUNT() OVER() as total
    FROM posts
    left outer join users
    on posts.userid = users.id
    left outer join comments
    on comments.postId = posts.id
    left outer join categoriesToPosts
    on categoriesToPosts.postId = posts.id
    left outer join categories
    on categoriesToPosts.categoryId = categories.id
    group by posts.id
    order by posts.updatedOn desc
    limit 10
    offset 0
Was this page helpful?