Click here to Skip to main content
14,361,357 members
   

C#

 
QuestionC# List: How to do 3 joins for better performance Pin
Mou_kol7-Apr-19 3:44
memberMou_kol7-Apr-19 3:44 
AnswerRe: C# List: How to do 3 joins for better performance Pin
Gerry Schmitz7-Apr-19 7:17
mveGerry Schmitz7-Apr-19 7:17 
GeneralRe: C# List: How to do 3 joins for better performance Pin
Mou_kol7-Apr-19 9:06
memberMou_kol7-Apr-19 9:06 
AnswerRe: C# List: How to do 3 joins for better performance Pin
Dave Kreskowiak7-Apr-19 7:39
mveDave Kreskowiak7-Apr-19 7:39 
GeneralRe: C# List: How to do 3 joins for better performance Pin
Mou_kol7-Apr-19 9:05
memberMou_kol7-Apr-19 9:05 
GeneralRe: C# List: How to do 3 joins for better performance Pin
Dave Kreskowiak7-Apr-19 9:29
mveDave Kreskowiak7-Apr-19 9:29 
GeneralRe: C# List: How to do 3 joins for better performance Pin
Mou_kol8-Apr-19 10:06
memberMou_kol8-Apr-19 10:06 
GeneralRe: C# List: How to do 3 joins for better performance Pin
Dave Kreskowiak8-Apr-19 10:24
mveDave Kreskowiak8-Apr-19 10:24 
Nothing is wrong with them.

Just when you go to do your query, you're going it in memory in a DataSet or DataTable. Those are not really optimized to do queries against. There are no indexes in a DataSet or DataTable. So when you go do your query, you're doing what's called a "table scan". You're looking and comparing every single row in every table involved in the query. You're also running both Trim and ToUpper on every single field you specified them on for every single row in all of your related tables. You're calling those methods literally tens of thousands of times, which is going to slow your query speed considerably.

An XML file is NOT a database. XML is used to format data for transfer. If you're trying to use an XML file as a database, you're making a huge mistake.

You could improve query performance while still using an XML file, but you're going to be writing code to
* custom build a DataSet, with all of your related DataTables,
* importing the data from the XML file with custom code, including calling Trim and ToUpper to normalize the data,
* creating DataView objects on your tables, and sorting them appropriately which will create indexes that will improve query performance.

But, you're never going to get the performance of a dedicated database engine that's built for the purpose of querying.

AnswerRe: C# List: How to do 3 joins for better performance Pin
Mycroft Holmes7-Apr-19 13:17
memberMycroft Holmes7-Apr-19 13:17 
GeneralRe: C# List: How to do 3 joins for better performance Pin
Mou_kol8-Apr-19 10:09
memberMou_kol8-Apr-19 10:09 
QuestionHow to make code run differently depending on the platform it is running on? Pin
Xarzu5-Apr-19 7:44
memberXarzu5-Apr-19 7:44 
AnswerRe: How to make code run differently depending on the platform it is running on? Pin
Richard Deeming5-Apr-19 8:15
mveRichard Deeming5-Apr-19 8:15 
AnswerRe: How to make code run differently depending on the platform it is running on? Pin
Gerry Schmitz5-Apr-19 10:54
mveGerry Schmitz5-Apr-19 10:54 
AnswerRe: How to make code run differently depending on the platform it is running on? Pin
jschell7-Apr-19 10:00
memberjschell7-Apr-19 10:00 
Questionc# Pin
Member 142150015-Apr-19 5:29
memberMember 142150015-Apr-19 5:29 
AnswerRe: c# Pin
OriginalGriff5-Apr-19 5:39
protectorOriginalGriff5-Apr-19 5:39 
QuestionRe: c# Pin
ZurdoDev5-Apr-19 5:49
professionalZurdoDev5-Apr-19 5:49 
AnswerRe: c# Pin
Dave Kreskowiak5-Apr-19 14:03
mveDave Kreskowiak5-Apr-19 14:03 
QuestionHow to convert emoji's unicode strings Pin
Vimalsoft(Pty) Ltd4-Apr-19 21:57
professionalVimalsoft(Pty) Ltd4-Apr-19 21:57 
AnswerRe: How to convert emoji's unicode strings Pin
OriginalGriff4-Apr-19 22:35
protectorOriginalGriff4-Apr-19 22:35 
GeneralRe: How to convert emoji's unicode strings Pin
Vimalsoft(Pty) Ltd5-Apr-19 3:13
professionalVimalsoft(Pty) Ltd5-Apr-19 3:13 
QuestionHow do I set a breakpoint in an attached process in visual studio? Pin
Xarzu4-Apr-19 9:43
memberXarzu4-Apr-19 9:43 
AnswerRe: How do I set a breakpoint in an attached process in visual studio? Pin
ZurdoDev4-Apr-19 10:20
professionalZurdoDev4-Apr-19 10:20 
GeneralRe: How do I set a breakpoint in an attached process in visual studio? Pin
Xarzu5-Apr-19 5:22
memberXarzu5-Apr-19 5:22 
AnswerRe: How do I set a breakpoint in an attached process in visual studio? Pin
Dave Kreskowiak4-Apr-19 10:24
mveDave Kreskowiak4-Apr-19 10:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.