async _getNewsletterSubscriberDeltas(newsletterId, options = {}) {
        // Build optimized deltas query - avoid expensive JOIN
        let deltasQuery = this.knex('members_subscribe_events as mse')
            .select(
                this.knex.raw(`DATE(mse.created_at) as date`),
                this.knex.raw(`SUM(CASE WHEN mse.subscribed = 1 THEN 1 ELSE -1 END) as value`)
            )
            .where('mse.newsletter_id', newsletterId)
            .whereNotExists(function () {
                this.select('*')
                    .from('members as m')
                    .whereRaw('m.id = mse.member_id')
                    .where('m.email_disabled', 1);
            })
            .groupByRaw('DATE(mse.created_at)')
            .orderBy('date', 'asc');

        // Apply date filters early to reduce dataset
        if (options.date_from) {
            deltasQuery.where('mse.created_at', '>=', options.date_from);
        }
        if (options.date_to) {
            deltasQuery.where('mse.created_at', '<=', `${options.date_to} 23:59:59`);
        }

        return await deltasQuery;
    }
Optimized query to get newsletter subscriber deltas
@private