fast search in a 10 million records table with unique index column of SQL server 2008 R2 on win 7 -
I need to do a quick search in a column, in which window 7 on the SQL Server 2008 R2 table shows floating point The number includes I
The table has 10 million records.
The ID is the priority, I have to search for the "Price" column for any value, such that I can find the nearest point of the point given in the table.
Proximity is defined as the full value of the difference between the given value and the column value.
Small value, close
I would like to use binary search
I want to set a unique index on the value column.
But, I am not sure if I search for the value given in the column, then the table will be sorted every time or not?
Or, it only changes the table once because I have set the value column as a unique index?
Is there a better way to do this search?
Whenever I do a search then do a sorting? I need to do several times of searching in the table. I know that the time of sorting is O (n.lg n) index can actually do this for me? Or is index linked with a sorted tree to keep the column values?
When an index is set, the value is sorted? I do not have to sort every time when I search?
Any help would be appreciated.
Thank you
Sorry for my initial reaction, no, not even me An index can create, it will not be able to use it because you are not searching on a given value, but there is a difference between the difference between that value and the value column in the table. You can create a function based pointer, but you must specify the # that you are searching for, which is not static.
Looking at this, I will see enough RAM to swallow the entire table. To wit. If the table is 10 GB, then try to get 10 GB of RAM allocated for caching.
SQL is not itself complicated, it is actually only an issue of performance. If you do not believe in some trial and error, you can create an index on the price column, the top 5 ID, ABS (99 - And then search for the following types -
Choose the top 5 id, ABS (99-val) as a different from TBF, where ward 2 is between 99-30 and 99 + 30 The above query value will use the index on the column, because this value is searching on multiple values in the column, that column and X (2 There is no difference between the values of the different things), however, there is no guarantee that it will return 5 rows, if it is actually 30 rows 99 (69 to 129) of 5 rows. If it is present within, then it will return only 5 rows. If it does not return 2, 3, etc, but not 5, then you have to run the query again and expand the range, and continue doing so You do not set your top 5. However, these questions should be run in a little bit faster. Index and firing against blindness, then you can give it a shot. It may take some time to make the index, so you will want to make that part overnight.
Comments
Post a Comment