private SelectConditionStep<Record2<Long, Long>> createBaseEffectiveStreamsQuery(
            final DSLContext context,
            final int feedId,
            final int metaTypeId) {

        final byte unlockedId = MetaStatusId.getPrimitiveValue(Status.UNLOCKED);

        // Force the idx to ensure mysql uses the idx with feed_id|effective_time rather than
        return context.select(
                        meta.ID,
                        meta.EFFECTIVE_TIME)
                .from(meta)
                .where(meta.FEED_ID.eq(feedId))
                .and(meta.TYPE_ID.eq(metaTypeId))
                .and(meta.STATUS.eq(unlockedId));
    }
@return True if any term in any rule expression uses at least one of {@code fields}.
stroom-meta/stroom-meta-impl-db/src/main/java/stroom/meta/impl/db/MetaDaoImpl.java