Help using mva

Hi all,

I am trying to index an array (i.e. add an mva) to a term in an index that I have already created. I am starting from the following schema:

collection CondensedCalendar {
  history_days 30
  index findCondCalendarByTypeAndArea {
    terms [.type, .area]
    values [.hash, .children]
  }
  index findCondCalendarByTypeAndPostcode {
    terms [.type, .postcodes]
  }
  index findCondCalendarByHash {
    terms [.hash]
    values [.ref]
  }
}

When attempting to index on the postcodes array, by converting to mva(.postcodes) I experience a write limit error. Why would this be happening? This particular collection is not large, nor is the schema from what I can gather. Could I be attempting the modification incorrectly?

Having seen rate limits previously, I am currently on the PAYG plan.

Thanks
Darryl

Hi @Darryl_Naidu! Index builds require read, write and compute to complete, just as queries do. Indexes - Fauna Docs

If the collection contains 128 or fewer documents, Fauna builds the index in the same transaction as the collection update. The index is immediately queryable.

When the index is built in a single transaction, that means that all the read, write, and compute are charged in a single transaction. You will receive a throttling error if the index build costs more than your limits. Plan details - Fauna Docs

Fauna throttles requests when:

  • A single query’s operations exceeds your account’s throughput limits.
  • Total operations per second exceed your account’s throughput limits. Operations can accumulate across multiple queries.

I don’t think there is a way to force the background index build, other than have more than 128 documents. I am checking.

UPDATE: Indeed, there is no way to force the index build into a background task, other than having more than 128 documents in your collection.

Hi @Darryl_Naidu We have deployed an update so that synchronous index builds do not trigger throttling errors. Thanks again for reporting and for your continued feedback!

Thanks so much @ptpaterson and team.