29-Aug-2007
sql
627 views
I am looking for a code (or command line software) that able to format/tidy-up SQL string to make it readable and doesn’t irritate the eyes. So far I have found:
- SQLinForm
It’s quite handy, you can run it on your browser and download the offline version which is packaged into one single Java Jar file. Unfortunately, I’m looking for something with with command line or open source. At least with command line support I can invoke it from my .NET program to process the temporary file.
- SQL Online Formatter
Still without the programmability support.
- SQL Review
With command line support. Unfortunately It’s throwing error on one of my stored procedure, but it still gives you the output.
- Pl/Sql Tidy
This program is only available in command line. Unfortunately, it never able to process my stored procedure. I not so sure whether it’s still maintained.
- Using Flex Script.
This page is pure inspirational. It immediately opened up my eyes for the possibility of using Flex or Regular Expression. I think will stick to this solution.
Although I have made up my mind, I will provide the output of each program in the next posting. Hopefully once I am be able to port VS. Babu’s lex script (or make my own regular expression code), I will share it with you all.
Credits:
1. Carson McDonald
About Hardono
Howdy! I'm Hardono. I am working as a
Software
Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.
24-Aug-2007
.net
480 views
Almost losing sleep because of my colleague’s question, I posted the question in .NET Groups where I frequently hang out.
One contributor suggested me to use DataTable.Rows.Find(), especially when we are searching by the Index column of that DataTable. I never heard of this, so I keep it noted as an additional advise to my colleague.
After much thinking, I somehow became doubting that DataTable.Select() is the actual source of the bottleneck. So this morning I asked her to run the profiler to check the performance of her program. The profiler’s result proven my doubt. The bottleneck was caused by multiple calling of Web Services.
All this time I already have a little discomfort with Web Service. I thought the overhead of transmitting data by text XML is too much, especially when you have thousands of records transmitted at an instance. So I spent a little time to googling for opinions that against Web Service (Web Service here refers to those web services that commonly implemented using SOAP). Eventually, I stumbled to this page. I highly recommend it. It’s funny, it’s witty and you might want to use it as an argument when debating against SOAP proponents 🙂
Talking about Profiler, she is using ANTS Profiler. It’s not free 🙂 But you could download the 14-days trial. And of course you can always ask Google for a help.
About Hardono
Howdy! I'm Hardono. I am working as a
Software
Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.
24-Aug-2007
.net
3,496 views
Today one colleague of mine asking me for tips on improving the DataTable.Select() performance. Apparently she has a data table which contains tens of thousands of records which some of the rows need to be processed together.
This particular question left me scratching my head. The only thing that I can suggest were:
- Make sure when populating the data table from the database, the data are already sorted
- Make sure the filter parameter of the Select() method is selecting by integer data
Come to think of it, I don’t really know how actually the Select() method is done. Is it using Binary Search, Linear Search, Interpolation Seach or any other search method that I never come across with.
If the case is when the data was fetched from database already in order of an ID, let say CustomerID and the DataTable.Select() is using “CustomerID=1001”, is there any way to optimize this further?
I’ll get back to you when I found the answer. Or maybe you have the answer?
About Hardono
Howdy! I'm Hardono. I am working as a
Software
Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.