Hi,
I am encountering issue when
selecting records from INFORMATION_SCHEMA.COLUMNS
sometimes program gets stucks.
Also no error in log and re-run no issue.
Please advise for a better alternative/approach are welcome.
Regards
Shehzad
Hi,
I am encountering issue when
selecting records from INFORMATION_SCHEMA.COLUMNS
sometimes program gets stucks.
Also no error in log and re-run no issue.
Please advise for a better alternative/approach are welcome.
Regards
Shehzad
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Shehzad KhanPosted Mar 10, 2024, 2:55 PM
Hi Tuhin,
Thanks for sharing,
Can u share some example of parallel LINQ (PLINQ) or the Task Parallel Library (TPL).
Regards
Shehzad
Tuhin PaulPosted Mar 10, 2024, 2:41 AM
Asynchronous methods can improve the responsiveness of your application by allowing it to perform non-blocking I/O operations. However, it's crucial to use them judiciously and understand their implications, such as potential thread pool exhaustion or increased complexity in error handling.
In addition to using asynchronous methods for I/O-bound operations, consider parallelizing CPU-bound operations using techniques such as parallel LINQ (PLINQ) or the Task Parallel Library (TPL). This can help utilize multi-core processors and improve overall performance.
Tuhin PaulPosted Mar 10, 2024, 2:40 AM
Before optimizing queries and using asynchronous methods, it's essential to identify the specific bottlenecks causing the program to get stuck. This may involve profiling the application to pinpoint areas of slow performance or using monitoring tools to analyze database queries and their execution times.
Once you've identified the bottleneck queries, focus on optimizing them by adding appropriate indexes, rewriting complex queries, or using query hints to improve query execution plans. Database tuning tools and query analyzers can assist in this process.
Shehzad KhanPosted Mar 7, 2024, 6:20 AM
Hi Jayraj,
Thanks for replying,
Let me check,
In where filter we have table_name and column_name,
Howvever this is a system view where we are unable to create index
Regards
Shehzad
Jayraj ChhayaPosted Mar 7, 2024, 5:56 AM
When your program gets stuck without any errors, it could be due to various reasons such as blocking operations, deadlocks, or long-running queries. To troubleshoot this issue, you can start by checking the database performance, query execution time, and any locks on the tables being accessed.
One approach is to optimize your query by adding appropriate indexes to the columns being used in the
SELECTstatement. Additionally, consider using asynchronous methods to prevent blocking the main thread.Here's an example of using asynchronous methods in C# to execute a query:
By optimizing your queries and using asynchronous methods, you can improve the performance and prevent your program from getting stuck during database operations.