Nevron Gauge for SharePoint
Skip Navigation Links
C# Corner Home
Forum Home
Latest 50
Unanswered
Win Prizes
All Time Leaders
Jump to CategoryExpand Jump to Category
Login 
    Welcome Guest!
 Search Forum For :  
X
 Login
Please login to submit a new post, reply and edit exiting posts, see user profiles, and access more features. If you are not a registered member, Register here.
User Id / Email:
Password:  
Forgot Password | Forgot UserName
   Home » Windows Azure » Database performace help
       
Author Reply
Darnell Dudley
posted 616 posts
since Feb 20, 2010 
from

Database performace help

  Posted on: 11 Feb 2012       
I have a question, do you think its wise, I am looking for speed performance. Lets say I have 300,000 records in the database.  Basically I want to Execute the fill  below before or load the data before entire application loads. I would have a progress bar that basically letting the user data is being loaded. One thing I did notice once the I have executed fill before, I use linq to pull  from the properties below, the queries works fast.

private databaseDataSet.testTable redTable { get; set; }
private databaseDataSet.testTable blueTable { get; set; }
private databaseDataSet.testTable purpleTable { get; set; }
private databaseDataSet.testTable greenTable { get; set; }
private databaseDataSet.testTable yellowTable { get; set; }
private databaseDataSet.testTable brownTable { get; set; }


        /// <summary>
        /// Initializes the data.
        /// </summary>
        public void InitializeData()
        {

            this.TableAdapter1.Fill(databaseDataSet.red);
            redTable = databaseDataSet.red;

            this.TableAdapter2.Fill(databaseDataSet.blue);
            blueTable = databaseDataSet.blue;

            this.TableAdapter3.Fill(databaseDataSet.green);
            greenTable = databaseDataSet.green;

            this.TableAdapter4.Fill(databaseDataSet.yellow);
            yellowTable = databaseDataSet.yellow;

            this.TableAdapter5.Fill(databaseDataSet.purple);
            purpleTable = databaseDataSet.purple;

            this.TableAdapter6.Fill(databaseDataSet.brown);
            brownTable = databaseDataSet.brown;

        }
Vulpes
posted  5419 posts
since  Feb 28, 2011 
from 

 Re: Database performace help
  Posted on: 12 Feb 2012        0  
You could try using a BackgroundWorker to load the data. There's actually an example which uses a ProgressBar in the MSDN docs for this class:


This won't actually speed up the loading of the data unless you have multiple processors or cores but it will prevent the UI from freezing in the meantime.
Darnell Dudley
posted  616 posts
since  Feb 20, 2010 
from 

 Re: Database performace help
  Posted on: 12 Feb 2012        0  
I know how to use background workers, thats not the problem.  whether i am using a background worker or not, I want to know, what will give me speed performance. What I was thinking about doing is just fill everything either on a back ground worker or excuting the fills before the application launch fully, that way it wont take long to query or retrieve data.

What would you do, and how to speed performance.
Darnell Dudley
posted  616 posts
since  Feb 20, 2010 
from 

 Re: Database performace help
  Posted on: 12 Feb 2012        0  

what do you mean by multiple processors or cores vuples, i just want to make sure i am on the right page.

"This won't actually speed up the loading of the data unless you have multiple processors or cores but it will prevent the UI from freezing in the meantime."
Vulpes
posted  5419 posts
since  Feb 28, 2011 
from 

 Re: Database performace help
  Posted on: 13 Feb 2012        0  
If you have a single processor then, no matter how many threads are running on it, they can only do the same overall amount of work in a given time; in fact overall work will be slightly lower because of the overhead of creating, managing and switching between threads.

If you have multiple processors or a multi-core machine (commonplace, of course, nowadays), then different threads can be run on different processors or cores, which enables you to do more work in a given time.

So, the point I was trying to make is that the background worker won't speed up the loading of the data on a single processor machine but (because the operating system will be switching between the threads) it will stop your UI from freezing until all the data has been loaded.

On the other hand, if you had a dual core machine, then the data could be loading on the background thread (running on one core) whilst the UI was concurrently loading on the UI thread (running on the other core).

Provided your query is efficient, there's probably little you can do to increase the speed at which the data is pulled in from the database server. Of course, once the data has been loaded into a DataSet in memory then subsequent accesses will be very fast.

Sam Hobbs
posted  6490 posts
since  Sep 07, 2009 
from  Los Angeles, California, USA

 Re: Database performace help
  Posted on: 13 Feb 2012        0  
If you do not have indexes that the query can use then the most effective way to improve performance is to create indexes.

If the database is the one I am familiar with, then we have known for a long time that it needs to be redesigned. Database design is something that a professional DBA must be tough about; it can be a difficult job just because it is tough to tell people that the database must be designed in a manner that the experts know is best. You are probably in the position where you are told you must design the database a certain way but it is not the way that database experts would design it so that might be the cause of the current problem.
Thinking is a feeling; pleasant for some and unpleasant for others.
Darnell Dudley
posted  616 posts
since  Feb 20, 2010 
from 

 Re: Database performace help
  Posted on: 13 Feb 2012        0  
Hi sam, the project you were talking about was learning curve for me coming out of college, I am much better database architect now then  two years ago. Since then I have been on at least up to 6 differennt database application developments ot task using Infragistics control etc..... I learn alot from you whether you believe or not.  We are no longer using Access, I am using SQL Server 2008, and one of my task now I am using MySql which I hate so much lolololol. SQL Server is much better to me when comes to editing Editor purposes and much more. But yeah my expertis when it comes to designing databases has went up tremendously.
Darnell Dudley
posted  616 posts
since  Feb 20, 2010 
from 

 Re: Database performace help
  Posted on: 13 Feb 2012        0  
Sam I will looking into the  indexes as far as speed goes. What I notice just few moments ago. I just created a view , a view seems to work much faster then the table adapters for somereason. I wonder why.

Vuples all along the reason why the database was taking long was because of a network issue, I was also on vpn. As soon as I connected to the iternet using an ethernet cable, the database was working as fast as ever. So yea when working wireless, you will not get your best performance. At least in my case, I don't. I get alot of timeout errors when working wireless.
Sam Hobbs
posted  6490 posts
since  Sep 07, 2009 
from  Los Angeles, California, USA

 Re: Database performace help
  Posted on: 13 Feb 2012        0  
Yes, Darnell I know your connection is slow. You really need to get a wired connection. I have Verizon FiOS, which is a fiber optic connection, and it is fast. I would have mentioned things like the connection but I assumed that was already considered.

It is good to hear that you are finally using SQL Server instead of Access.

I don't know about the technical details of views. There are at least two reasons I can think of that a view would provide better performance. I think that a view is executed in the server before sending data to the workstation, which would require less data across the network. I know that stored procedures work like that so I might have views confused with stored procedures. Another possible explanation is when you create a view the database system can analyze the requirements and decide what is the best way to do it. Of course I am not sure of any of that.
Thinking is a feeling; pleasant for some and unpleasant for others.
       
Nevron Gauge for SharePoint
Dynamic PDF
ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications. Visit DynamicPDF here
Introducing MaxV - one click. infinite control. Hyper-V Hosting from MaximumASP.
Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Nevron Chart for .NET 2010.1 Now Available
The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
ASP.NET 4 Hosting
Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
6 Months Free & No Setup Fees ASP.NET Hosting!
 Hosted by MaximumASP  |  Found a broken link?  |  Contact Us  |  Terms & conditions  |  Privacy Policy  |  Site Map  |  Advertise with us
Current Version: 5.2011.3.12
 © 1999 - 2012  Mindcracker LLC. All Rights Reserved