Click here to Skip to main content
15,889,116 members
Home / Discussions / C#
   

C#

 
QuestionC# List: How to do 3 joins for better performance Pin
Mou_kol7-Apr-19 2:44
Mou_kol7-Apr-19 2:44 
AnswerRe: C# List: How to do 3 joins for better performance Pin
Gerry Schmitz7-Apr-19 6:17
mveGerry Schmitz7-Apr-19 6:17 
GeneralRe: C# List: How to do 3 joins for better performance Pin
Mou_kol7-Apr-19 8:06
Mou_kol7-Apr-19 8:06 
AnswerRe: C# List: How to do 3 joins for better performance Pin
Dave Kreskowiak7-Apr-19 6:39
mveDave Kreskowiak7-Apr-19 6:39 
GeneralRe: C# List: How to do 3 joins for better performance Pin
Mou_kol7-Apr-19 8:05
Mou_kol7-Apr-19 8:05 
GeneralRe: C# List: How to do 3 joins for better performance Pin
Dave Kreskowiak7-Apr-19 8:29
mveDave Kreskowiak7-Apr-19 8:29 
GeneralRe: C# List: How to do 3 joins for better performance Pin
Mou_kol8-Apr-19 9:06
Mou_kol8-Apr-19 9:06 
GeneralRe: C# List: How to do 3 joins for better performance Pin
Dave Kreskowiak8-Apr-19 9:24
mveDave Kreskowiak8-Apr-19 9: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 12:17
professionalMycroft Holmes7-Apr-19 12:17 
GeneralRe: C# List: How to do 3 joins for better performance Pin
Mou_kol8-Apr-19 9:09
Mou_kol8-Apr-19 9:09 
QuestionHow to make code run differently depending on the platform it is running on? Pin
Xarzu5-Apr-19 6:44
Xarzu5-Apr-19 6:44 
AnswerRe: How to make code run differently depending on the platform it is running on? Pin
Richard Deeming5-Apr-19 7:15
mveRichard Deeming5-Apr-19 7:15 
AnswerRe: How to make code run differently depending on the platform it is running on? Pin
Gerry Schmitz5-Apr-19 9:54
mveGerry Schmitz5-Apr-19 9:54 
AnswerRe: How to make code run differently depending on the platform it is running on? Pin
jschell7-Apr-19 9:00
jschell7-Apr-19 9:00 
Questionc# Pin
Member 142150015-Apr-19 4:29
Member 142150015-Apr-19 4:29 
AnswerRe: c# Pin
OriginalGriff5-Apr-19 4:39
mveOriginalGriff5-Apr-19 4:39 
QuestionRe: c# Pin
ZurdoDev5-Apr-19 4:49
professionalZurdoDev5-Apr-19 4:49 
AnswerRe: c# Pin
Dave Kreskowiak5-Apr-19 13:03
mveDave Kreskowiak5-Apr-19 13:03 
QuestionHow to convert emoji's unicode strings Pin
Vimalsoft(Pty) Ltd4-Apr-19 20:57
professionalVimalsoft(Pty) Ltd4-Apr-19 20:57 
AnswerRe: How to convert emoji's unicode strings Pin
OriginalGriff4-Apr-19 21:35
mveOriginalGriff4-Apr-19 21:35 
GeneralRe: How to convert emoji's unicode strings Pin
Vimalsoft(Pty) Ltd5-Apr-19 2:13
professionalVimalsoft(Pty) Ltd5-Apr-19 2:13 
QuestionHow do I set a breakpoint in an attached process in visual studio? Pin
Xarzu4-Apr-19 8:43
Xarzu4-Apr-19 8:43 
AnswerRe: How do I set a breakpoint in an attached process in visual studio? Pin
ZurdoDev4-Apr-19 9:20
professionalZurdoDev4-Apr-19 9:20 
GeneralRe: How do I set a breakpoint in an attached process in visual studio? Pin
Xarzu5-Apr-19 4:22
Xarzu5-Apr-19 4:22 
AnswerRe: How do I set a breakpoint in an attached process in visual studio? Pin
Dave Kreskowiak4-Apr-19 9:24
mveDave Kreskowiak4-Apr-19 9: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.