Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 quick way to search for a value in a table

Author  Topic 

san79
Starting Member

42 Posts

Posted - 2008-03-31 : 09:52:58
hi
is there any quick way to search for a value in a table which stores very large number of data say around 1 million records.

best regards
s.an

Imukai
Starting Member

29 Posts

Posted - 2008-03-31 : 09:59:01
SELECT * FROM Table WHERE Column = 'whatever'

"Quickness" is a relative term and will depend on whether that table is indexed, how fast the server is, memory, disk defragmentation, orientation of the moon, etc.
Go to Top of Page

elancaster
A very urgent SQL Yakette

1208 Posts

Posted - 2008-03-31 : 09:59:38
you mean other than a select query? or are you asking about indexes / optimisation etc?

Em
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-03-31 : 13:14:51
Can you specify what exactly you're looking at?
Go to Top of Page

san79
Starting Member

42 Posts

Posted - 2008-04-01 : 02:13:14
yes it is other than select query, i am having an indexed table i am trying to find a record if it is already exists or not, using select query but during course of operations the time consumed by select command is getting greater and greater, so i need some sort of other ways to retrieve the record quickly than select command. my system is a PIV 2.3 GHZ with 512 MB RAM any alternative ways are greatly appriciated
Go to Top of Page

Imukai
Starting Member

29 Posts

Posted - 2008-04-01 : 07:36:13
Pretty sure a SELECT statement is your only option for selecting a record from the database. If your data has grown to be so large as to have a performance impact - I would suggest first that you add memory to that server. 512MB is not a lot of room for SQL to breathe at all. Memory is cheap.. and increasing that to 2GB would/should give you a dramatic boost in performance.

Other than that you might look into archiving older data into a 2nd database, so your active database only contains relevant records? But honestly - at least to me, system memory should be your first priority in that case.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-04-01 : 10:19:22
You told your table is indexed. But are you sure that you've proper indexes in place? Also have you had a look at execution plan to see if existing index is being used by query engine?
Go to Top of Page

san79
Starting Member

42 Posts

Posted - 2008-04-02 : 00:56:19
i have indexed the billno column which i search frequently , but i dont know how to use execution plan to check index being used by query engine any help?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-04-02 : 04:36:54
Just select display actual execution plan icon on top menu bar of SSMS. Then you will get execution plan tab along with results. Look into plan and check if its having index scan/seek step for your created index.
Go to Top of Page
   

- Advertisement -