Note that there are some explanatory texts on larger screens.

plurals
  1. POOptimizing the Generic List WHERE
    primarykey
    data
    text
    <p>The statement below takes around 6 seconds to produce the output when the SecurityInfoMasterList has around 11,000 items and listClassiNode has around 750 items. </p> <p>Is there any other way of doing this to achieve the same result but with better performance?</p> <pre><code>List&lt;SecurityInfo&gt; listSecurityInfo = SecurityInfoMasterList.Where(c =&gt; listClassiNode.Any(d =&gt; c.SX == d.Exch &amp;&amp; c.Instrument == d.Instrument)).ToList(); </code></pre> <p>I have been trying to use for loop but didnt see much improvement.</p> <p>Updated:</p> <p>listClassiNode is a List</p> <pre><code>[Serializable] public class SecurityInfo { public string SecurityID { get; set; } public int SecurityTypeID { get; set; } public string Code { get; set; } public string SecurityName { get; set; } public int DB { get; set; } public string ExchangeName { get; set; } public DateTime FirstDate { get; set; } public int StatusCode { get; set; } public long GICS { get; set; } public string ICB { get; set; } public string Sector { get; set; } public string IndustryGroup { get; set; } public string Industry { get; set; } public string Instrument { get; set; } public string TypeDescription { get; set; } public string SX { get; set; } public string GUID { get; set; } } [Serializable()] public class ClassificationNode { public string Exch { get; set; } public string Instrument { get; set; } public string Prefix { get; set; } public string Name { get; set; } public string Level { get; set; } } </code></pre> <p>Alan</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload