AI search has a quiet flaw: it gets slower with every record you add. On my 500,000 products, one search took 14.2 seconds. Then I right-clicked one field in the Structure editor, and the same search took 0.33 seconds. That right-click is vector indexing, new in 4D 21 R5.
40× faster search
1 right-click, query unchanged
520/520 measurements with identical results, index or not
3 min to index 500,000 products, once
About the numbers: I recreated one shop’s back office on a normal working day. 4D Server ran on a MacBook Pro (6-core Intel Core i7, 16 GB of RAM, 4 GB of cache) with five simulated users working at the same time: three searching the catalog, one browsing filtered pages, one running reports. At each catalog size, the index was built fresh and left untouched while I measured. Every number is the median of the measured runs. Your server will give different times, so read the gain, not the seconds.
Built like the applications you ship
No random vectors here. The test app is a retailer’s back office on real Open Food Facts data, with supplier names spelled every way suppliers spell them, and four AI features your users would actually click:
Search in the user’s own words Users type what they mean and find what you sell.
Substitutes Out of stock becomes a sale you keep.
Supplier onboarding Every price-list line finds your product, in the supplier’s spelling, no barcode needed.
Duplicate check Same product, two barcodes: caught before it splits your stock.
Each product’s embedding is stored twice, in an indexed field and an unindexed one, and each query runs on both. Only the index changed.
Fast enough to put AI on every screen
Each feature is one similarity query over the whole catalog. At 500,000 products:
Nobody waits ten seconds twice. They stop clicking, and the AI feature you shipped becomes decoration. Under a second, on a busy server, it becomes something people use: in the search box, on the out-of-stock page, in the import screen, on every save.
The bigger your customer, the bigger the win
Your top accounts have the biggest catalogs, so they sit through the longest waits. With the index, the wait barely moves as the catalog grows. Your best customers stop paying a penalty for being your best customers.
Lenient threshold (0.45): the search box
At 50,000 products, the index saves half a second per search. At 500,000, it saves almost fourteen.
Strict threshold (0.97): exact matches
A strict question rules out almost the whole catalog at once, so the index answers in milliseconds at every size. Cheap enough to check every record you add, not only the ones someone remembers to review.
Jobs that took months now run overnight
A supplier import asks one question per line. A duplicate cleanup asks it per product. That is where seconds turn into days.
Nobody schedules a two-month cleanup, so the duplicates stay and your reports keep counting them twice.
Same results, with or without the index
Speed usually has a price. In 4D, it doesn’t.
Most vector indexes make the opposite trade. They are approximate: they buy speed by letting close matches slip, and some vendors warn in their own documentation that results change once you add the index.
Why that matters for your application:
- Build now, index later. Develop and test without an index. The day you add it, every search, threshold and test keeps working as before.
- Thresholds you can trust. A duplicate check or a supplier match catches the same records with the index on, instead of silently missing a few.
- Reproducible answers. The same question returns the same records, for your tests, your support team and any audit.
What it costs you
No code changes. Add the index and every query you already wrote runs on it. Each new record then costs about 1.5 ms of indexing.
The vectors come cheap too. 4D Embedding Studio, also new in 4D 21 R5, vectorizes 500,000 products in about 25 minutes for about $1.30 through 4D AIKIT and keeps them in sync in the background, so users never search a half-updated catalog.
See the gap for yourself
Clone Demo_Aisle and unzip Data.zip from its release next to the project folder. The products and a set of searches are already vectorized, so you can try it without an OpenAI key.
Open the app: the Vector search performance panel on the right times every search both ways. The first search after a restart is slower, because 4D loads the index from disk into the cache. After that it stays in memory, so run each search two or three times.
- Search. Click the search box and pick a vectorized search, or type your own words.
- Grow the catalog. It starts at 50,000 products. In Under the hood, click Add 50,000 products (about three minutes per batch), wait a few minutes for the index to settle, and search again. Keep going to 500,000.
- Run the batch jobs. In Suppliers, click Match to the catalog. In Duplicates, pick a category and click Check for duplicates. Run them before growing the catalog: at 500,000 products, a duplicate check on a large category can take an hour or more.
Then try it where it counts: index the vector field in your largest table, rerun your slowest search, and share your before and after on the 4D Forum.
Exclusive to 4D PartnersGet 4D 21 R5 Beta Newest featuresGet the latest Feature Release
Comments are not currently available for this post.