Skip to content

Business Central BC29: turning indexes on and off from AL

TechFabricUpdated 8 min readAnnouncements

An order placed on amtab.com reaches Business Central, the ERP that invoices it, without anyone retyping it. We built that order path, through AmTab's CRM and on Power Automate flows (case study). Each of those orders lands as inserts into Business Central tables, and every insert pays to maintain each secondary key on the tables it touches, whether anyone ever reads through that key or not.

Until now that cost was fixed when the app was compiled. In Business Central 2026 release wave 2 (BC29), AL code can turn database indexes off and on per company. The feature has been generally available since October 2026, under roadmap ID 573314. For a business, an index nobody reads means slower posting on every order and more database storage on the bill.

Before a release wave reaches a tenant we support, we check its extensions and flows against it. BC29 adds a question to that check. Which keys does each extension own, and who decides whether they stay on?

The writes: an integration like AmTab's

An integration like AmTab's writes all day. A buyer configures a table on amtab.com, the order goes through the CRM, and in Business Central it becomes a sales header and its lines. When the customer approves the quote it becomes an order, and the invoice follows from the same record. On the plant build, a Power Automate flow we built in a Business Central sandbox creates each supplier bill as a purchase invoice, with the Dext item ID stored as the external document number so nothing can post twice.

Each of those writes maintains every enabled secondary key on the table, in every company that has it.

Most of those keys come from the base application and the extensions on the tenant, not from the integration. A tenant running Insight Works warehouse apps, which we implement as an Insight Works partner, carries keys from those apps too, and every posting pays for all of them.

The reads we moved out of the ERP

Reads are the other half of the cost.

We've taken the heavy ones out of Business Central altogether.

On the new plant's leadership reporting, the receiving-exceptions report matches each Business Central receipt to its scale ticket and flags loads weighed but never received. The market-exposure report values each production order at that day's price and its own assay. Both are joins across systems the ERP never held, so we built them in Databricks and tested them end to end on sample data before go-live. We kept Business Central as the system of record, with none of the reporting load. An index added to the ERP for either report would have been a cost on every receipt posted, paid for a question leaders ask of a dashboard.

That's the split we'd keep, and it's why we'd turn down most requests for a new key that a report needs. The route for ERP data into a lakehouse is on our data integration page, and the choice between built-in reporting, Power BI and a lakehouse has a post of its own.

What changes in the extensions we write

Some keys still belong in the ERP, because a page or a posting routine reads them every day. Before BC29 an extension shipped such a key and every company paid for it, and only an administrator could switch it off, by hand, from the Table Data Management page.

Our consultants write the AL extensions on the Business Central systems they implement, and from BC29 those extensions can flip the same switch through codeunit 2000000029, "Index Management" (Yun Zhu's walkthrough). No extension we've shipped to a client uses it yet. When one does, a key that serves a single feature will ship with Enabled = false and be switched on from that feature's setup, only in the companies that use it. Business Central allows that because each company has its own copy of the table's indexes. On a tenant with eight companies where two use the feature, six stop paying for the index.

The feature will also have to work for a day without its index. Switching one off is immediate, but switching one on is queued for the next scheduled midnight process while SQL Server scans the table, so the setup page would say the feature is slow until tomorrow.

Orders from the store

Business Central writes

Supplier bills from a flow

Keys that pages and postings read daily

Feature keys shipped disabled

Switched on per company from setup

Data copied to Databricks

Cross-system reports and joins

Where we'd let index cost sit: writes and the keys their pages read stay in Business Central, and cross-system reporting runs in Databricks.

Who owns the switch

There's no licence to buy, and the real cost is ownership. An extension that manages its indexes in code and an administrator who manages them by hand now share one lever. If the app switches an index on at every upgrade and the client's administrator switches it off every quarter because it looks unused, the two will argue quietly for years. We'd settle with the client, before shipping, which of them wins, write it into the app's documentation, and have the AL code read the current state before changing anything.

What we'd measure first

It starts in the release-wave check, before any AL. We'd open Table Information on the tenant, take the five largest per-company tables, and read each index's storage and usage on the Table Data Management page. An index with no last user seek is a candidate. Then Database Missing Indexes, sorted by estimated benefit, which Microsoft calls suggestions, not mandates. The pair we'd hunt for is an index somebody pays for and nobody reads, on the same table as a suggestion nobody acted on.

Then the change, logged with its reason inside the app. In eighteen months somebody will ask why an index exists in company A and not in company B, and the answer should be somewhere they can find it.

Frequently asked questions

Would you add a Business Central index to speed up a month-end report?

Rarely. A report that runs twelve times a year shouldn't put a cost on every posting in between. On the plant reporting we built, the cross-system joins run in Databricks, and Business Central keeps only the keys its own pages and postings read. If the report has to stay inside Business Central, we'd look at the query and its FlowFields before the keys.

Should an extension turn its indexes on when it installs?

We wouldn't. A key that serves one feature ships disabled and is enabled from that feature's setup, company by company, and the install has to work without it, because an enabled index isn't built until the next scheduled midnight process.

Can a Business Central administrator undo an index change an extension made?

Yes. The AL methods and the Table Data Management page work the same switch, so an administrator can turn off what the extension turned on. That's why we'd agree with the client which side decides, and have the extension read an index's state before it changes it.

Where we do this work