Code Pages versus Locales/Locale Names

The question recently came up on why someone’s index range on a text column wasn’t working properly. It turns out they forgot to set the Code Page on the column, but they were still storing Unicode data in the column. So the question came up about just what the heck is a Code Page. I…


Using `esentutl.exe /vss` to examine an in-use database

This feature has been present in Exchange with eseutil.exe, but now it will be part of Windows 10 esentutl.exe. Normally, when we try to access ESE database files, we get ACCESS_DENIED, because the ESE engine opens files exclusively. VSS (Volume Shadow Copy Services) allows us to grab a Snapshot of the volume, and access the…


Sparse Files: ESE can now give space back to the file system

A long-standing limitation of ESE is that database files never shrink, even after deleting substantial amounts of the data. While the space is freed and is re-usable within the database, the on-disk size does not change. The main limitation is that the first page of each table can never be moved, so even if the…


cbKeyMost when indexing needs additional overhead

I recently helped someone track down why they were getting JET_errKeyTruncated. They declared an index over a JET_coltypLongBinary column with cbMax = 0x20c, and when they created the index, they specified cbKeyMost = 0x20c, and also passed in VistaGrbits.IndexDisallowTruncation (they were using ManagedEsent). But then they were getting JET_errKeyTruncated when setting a value with length…


ManagedEsent is in Windows 8.1 and on MSDN.

I’m super excited to share this: ManagedEsent is documented on MSDN: And it’s part of Windows 8.1. No need to download from CodePlex! Here’s what’s on my 8.1 machine: C:\Windows\assembly\NativeImages_v4.0.30319_32\Microsoft.Ic1a2041b#\3862e50725b3d2f5ef48c19f24b17ef3\\Windows\assembly\NativeImages_v4.0.30319_32\Microsoft.Ic1a2041b#\3862e50725b3d2f5ef48c19f24b17ef3\\Windows\assembly\NativeImages_v4.0.30319_64\Microsoft.Ic1a2041b#\85216777bd911aef15b30bda8b0046b8\\Windows\assembly\NativeImages_v4.0.30319_64\Microsoft.Ic1a2041b#\85216777bd911aef15b30bda8b0046b8\\Windows\Microsoft.NET\assembly\GAC_MSIL\microsoft.isam.esent.interop\v4.0_6.3.0.0__31bf3856ad364e35\Microsoft.Isam.Esent.Interop.dllC:\Windows\WinSxS\msil_microsoft.isam.esent.interop_31bf3856ad364e35_6.3.9600.16384_none_b4cbc5488cc56490\Microsoft.Isam.Esent.Interop.dll   Enjoy! -martin


Cost of JetIntersectIndexes

We recently had a question about JetIntersectIndexes()’s performance. Here’s what Brett wrote up:   Intersect is to save disk IO at the cost of CPU time. The cost of intersect indices, is the cost of iterating over ALL the index ranges (choice #3 below).  That may not sound like a savings, HOWEVER index entries are…


JetGetObjectInfo() does not get record count by default

We recently had the following question:  I am trying to get the space occupied by each table that we have by using JetGetObjectInfo. The api succeeds but it returns 0 for both number of cRecords and cPages.   JET_OBJECTINFO tableInfo = {0}; hr = ::JetGetObjectInfoA(m_spSession->GetSessionId(), m_dbId, JET_objtypTable, nullptr, strTableName, &tableInfo, sizeof(tableInfo), JET_ObjInfo); if (FAILED(hr)) return…


Introduction to Indices

ESE is an ISAM engine — Indexed Sequential Access Method. Wikipedia has an article on ISAMs: ESE allows you to insert data in a structured manner, with data types such as integer or strings. Then you need to be able to find the data, which is where indexing comes in. As one co-worker put it…


Sharp Corner: Close a table after creating it

The ESENT API has existed for a while, so there are quite a few oddities to it. After creating a database with ESENT, you need to close the returned JET_TABLEID. The original way to create a usable table was to create the table with JetCreateTable, add some columns with repeated calls to JetAddColumn, then index…


ManagedEsent is Metro Compliant

I’m inaugurating this blog with an announcement: ManagedEsent is Metro Compliant. What does this mean to you? If you write a Metro program in C#, you can grab ManagedEsent from CodePlex ( and you can use your favourite ESENT APIs from from C#, and still pass certification. The update is currently available only in source form (….