Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Exceptionally slow database response time on Linq query

By: a guest on Feb 26th, 2012  |  syntax: None  |  size: 1.42 KB  |  hits: 25  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. t.states = (from s in tmdb.tmZipCodes
  2.                         where zips.Contains(s.ZipCode) && s.tmLicensing.Required.Equals(true)
  3.                         group s by new Licensing {
  4.                             stateCode = s.tmLicensing.StateCode,
  5.                             stateName = s.tmLicensing.StateName,
  6.                             FIPSCode = s.tmLicensing.FIPSCode,
  7.                             required = (bool)s.tmLicensing.Required,
  8.                             requirements = s.tmLicensing.Requirements,
  9.                             canWorkWhen = s.tmLicensing.CanWorkWhen,
  10.                             appProccesingTime = (int) s.tmLicensing.AppProcessingTime
  11.                         }
  12.                             into state
  13.                             select state.Key).ToList();
  14.        
  15. s.tmLicensing.Required.Equals(true)
  16.        
  17. s.tmLicensing
  18.        
  19. t.states = (from s in tmdb.tmZipCodes
  20.             where zips.Contains(s.ZipCode) && s.tmLicensing.Required.Equals(true)
  21.             select new Licensing {
  22.                 stateCode = s.tmLicensing.StateCode,
  23.                 stateName = s.tmLicensing.StateName,
  24.                 FIPSCode = s.tmLicensing.FIPSCode,
  25.                 required = (bool)s.tmLicensing.Required,
  26.                 requirements = s.tmLicensing.Requirements,
  27.                 canWorkWhen = s.tmLicensing.CanWorkWhen,
  28.                 appProccesingTime = (int) s.tmLicensing.AppProcessingTime
  29.             }).Distinct().ToList();