Solved by setting Query.MaxItems:
<setting name="Query.MaxItems">
<patch:attribute name="value">1000</patch:attribute>
</setting>
Explanation:
In large projects you may have a lot of placeholders (more then 260 what is default amount of items Sitecore Query API reads at one time).
Sitecore team set the limitation but Placeholder cache was not fixed and still reads items only once so as a result placeholders which weren't added into cache because of the limitation are skipped.
This is the code of the cache manager taken from reflector:
public virtual void Reload()
{
lock (FieldRelatedItemCache.Lock)
{
this.itemIDs = new SafeDictionary<string, ID>();
Item[] local_1 = this.Database.SelectItems(string.Format("{0}//*[@@templateid = '{1}']", (object) this.ItemRoot.Paths.FullPath, (object) this.ItemTemplate));
if (local_1 == null)
return;
foreach (Item item_0 in local_1)
{
string local_3 = item_0[this.FieldKey];
if (!string.IsNullOrEmpty(local_3) && !this.itemIDs.ContainsKey(this.GetCacheKey(local_3)))
this.Add(local_3, item_0);
}
}
}