4D Blog

Home Product Take Control of the Cache Manager

Take Control of the Cache Manager

January 18, 2017

Product

4D v16 introduced a new fully optimized cache manager for the 64-bit product line. 4D v16 R2 is giving power to our advanced 4D developers to take control by themselves!

The cache manager internal algorithm is based on a priority concept associated to each object type to store in the cache memory. By default, the cache manager algorithm assigns a higher priority value for an index than for records. And recently used objects (records or indexes) have a higher priority to remain in the cache than objects that have not been used in the last two days, etc…

From 4D v16 R2, 4D developer can take the control. At startup, you can fine tune the priorities in cache for your tables, indexes and “big objects” depending on your application needs. On top of that, you can even define exceptions for a single process. When there are some specific operations to run, as for instance a large import, the 4D developer is the best to decide what table or index should have the higher priority in cache for a particular time frame.

New commands to control priority

A set of new commands allow very fine adjustments: for each index, each table, even with differences for the main record and the ‘big parts’ (blobs / text  / pictures / objects).

Define at startup the priority for all processes

SET TABLE CACHE PRIORITY
SET INDEX CACHE PRIORITY
SET BLOBS CACHE PRIORITY

Increase or decrease the priority defined on startup for the current process

ADJUST TABLE CACHE PRIORITY
ADJUST INDEX CACHE PRIORITY
ADJUST BLOBS CACHE PRIORITY

Read internal priority value (for debugging purpose only)

Get adjusted table cache priority
Get adjusted index cache priority
Get adjusted blobs cache priority

beware These commands must be used with care since it can affect database performance.

Examples

In the On Startup database method, you want to set a high priority for the [Customer]LastName field indexes:
SET INDEX CACHE PRIORITY([Customer]LastName;Cache priority very high)

You want to temporarily change the cache priority for the [Docs] table text fields stored in the data file when executing a sequential search:
ADJUST BLOBS CACHE PRIORITY([Docs];Cache priority very high)
QUERY([Docs];[Docs]Author#"A@") // sequential search on a non indexed field
// run several other queries or orders on the same table
// when finished, set back to normal cache priority
ADJUST BLOBS CACHE PRIORITY([Docs];Cache priority normal)

For more details, we invite you to take a look at the following article in the 4D v16 R2 documentation.

Discuss

Tags Database, Speed, v16 R2, v17

Latest related posts

  • February 3, 2026

    4D Write Pro – Adding a margin automatically when bullets are set using standard actions

  • January 22, 2026

    Transform Static Documents into Actionable Knowledge with AIKit

  • January 22, 2026

    Deploy Fluent UI effortlessly in your 4D applications

Caroline Briaud
Caroline Briaud
• 4D Product Team Leader •Caroline joined 4D SAS in July, 2013 as an Engineering Manager responsible for new features definition. Caroline helped the Engineering team to put in place the R-release concept, with the new development process definition and its application within 4D’s engineering teams.Caroline is now leading the 4D Product team, mainly made up of Product Owners which are representing the customers within Engineering.Caroline started her career as a software developer in the mobile phone industry. She specialized in program management with an American company in an international context spread across US, India and China.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • AI
  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 21 R2 Administration AI Artificial Intelligence Build application CI/CD Class Client/Server Code editor Collections Formula Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience vscode Web Word processor

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 21 R2 Administration AI Artificial Intelligence Build application CI/CD Class Client/Server Code editor Collections Formula Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience vscode Web Word processor
Subscribe to 4D Newsletter

© 2026 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy