|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Dataset or SQL? wich is faster?Hi,
I have a question, wich goes faster (The table has 15000 rows in it and growing every day)? - at the start of the program run a querry and put this in a dataset and during the program search the dataset for the information needed - use a SQL querry for every time you need some value from the database (wich will return 1 value)? Thanks Joris Once the table gets above over a certain size, running a SQL query will be
faster. Additionally, using up tons of memory to keep thousands of rows in memory at a time is wasteful. At some point, you won't have enough memory to contain the entire table anyway. Show quoteHide quote "Joris De Groote" <joris.degro***@skynet.be> wrote in message news:uTuLs52cGHA.1276@TK2MSFTNGP03.phx.gbl... > Hi, > > I have a question, wich goes faster (The table has 15000 rows in it and > growing every day)? > > - at the start of the program run a querry and put this in a dataset and > during the program search the dataset for the information needed > - use a SQL querry for every time you need some value from the database > (wich will return 1 value)? > > Thanks > Joris > So I'll use SQL, thanks!
Show quoteHide quote "Marina Levit [MVP]" <someone@nospam.com> wrote in message news:Og$$u72cGHA.2068@TK2MSFTNGP02.phx.gbl... > Once the table gets above over a certain size, running a SQL query will be > faster. > > Additionally, using up tons of memory to keep thousands of rows in memory > at a time is wasteful. At some point, you won't have enough memory to > contain the entire table anyway. > > "Joris De Groote" <joris.degro***@skynet.be> wrote in message > news:uTuLs52cGHA.1276@TK2MSFTNGP03.phx.gbl... >> Hi, >> >> I have a question, wich goes faster (The table has 15000 rows in it and >> growing every day)? >> >> - at the start of the program run a querry and put this in a dataset and >> during the program search the dataset for the information needed >> - use a SQL querry for every time you need some value from the database >> (wich will return 1 value)? >> >> Thanks >> Joris >> > > Additionally, don't forget about concurrency issues. What happens when another
user modifies a record you have in your dataset? If you are not worried about changing data, why bother with the dataset? Why not just use one of the types in System.Collection which are much smaller. With either in-memory representation of the data, you are still not benifiting from any indexing that the database uses to optomize your query. With the number of records you are talking, I would definately argue in favor of the database assuming network bandwidth isn't too much of an issue. If it is, I wouldn't want to think about sending 15000 records across the pipe either. Jim Wooley http://devauthority.com/blogs/jwooley/default.aspx Show quoteHide quote > Once the table gets above over a certain size, running a SQL query > will be faster. > > Additionally, using up tons of memory to keep thousands of rows in > memory at a time is wasteful. At some point, you won't have enough > memory to contain the entire table anyway. > > "Joris De Groote" <joris.degro***@skynet.be> wrote in message > news:uTuLs52cGHA.1276@TK2MSFTNGP03.phx.gbl... > >> Hi, >> >> I have a question, wich goes faster (The table has 15000 rows in it >> and growing every day)? >> >> - at the start of the program run a querry and put this in a dataset >> and >> during the program search the dataset for the information needed >> - use a SQL querry for every time you need some value from the >> database >> (wich will return 1 value)? >> Thanks >> Joris 15k record? lol
who gives a crap about 15k records; it's like nothing how wide is it? "Joris De Groote" <joris.degro***@skynet.be> wrote in message Generally speaking, I don't think the DataSet was designed to migrate the news:uTuLs52cGHA.1276@TK2MSFTNGP03.phx.gbl... > I have a question, wich goes faster (The table has 15000 rows in it and > growing every day)? > - at the start of the program run a querry and put this in a dataset and > during the program search the dataset for the information needed > - use a SQL querry for every time you need some value from the database > (wich will return 1 value)? functionality of a relational database server to client machines and, unless there is some very particularized reason for doing so, it seems inadvisable. Let the RDBMS do what it does very well; that's why you have it. It seems to me that the occasion to employ an in-memory relational store on the client is in situations where you are bringing together disparate and disconnected data sources that need to be related ... such as a scenario where have perhaps two SQL Server tables, one Oracle table and a local Access table which need to be treated as a single related collection. L
How to disable the numericupdown event firing?
Mailmerge Automation Problems VB Form: Controlbox = False byte array size for read or write of filestream Basic Database Questions How do I embed a text file in my exe? problem with code for dataset with mutilple tables Using VSS and VS.NET 2003 How to interrupt a running program How to kill a terminal server session (VB.NET) |
|||||||||||||||||||||||