Questions tagged [indexing]

Indexing data structures is a general technique to improve the speed of data lookups.

The purpose of storing an index is to optimize speed and performance in finding relevant documents for a search query. Without an index, the search process would scan every document in the corpus, which would require considerable time and computing power.

Indexes may benefit both read queries and updates. Many people wrongly believe indexes are only good for read queries. In general, there are three methods of indexing - non-clustered, clustered and cluster.

References:

Top Indexing Questions

By these questions, you will clear your concepts regarding indexing. And you can ask similar questions (not duplicate) with this tag.

33955 questions
9
votes
4 answers

How do you run Lucene on .net?

Lucene is an excellent search engine, but the .NET version is behind the official Java release (latest stable .NET release is 2.0, but the latest Java Lucene version is 2.4, which has more features). How do you get around this?
Kalid
  • 22,218
  • 14
  • 44
  • 46
9
votes
3 answers

Find array index if given value

I want to retrieve the index in the array where the value is stored. I know the value of the item at that point in the array. I'm thinking it's similar to the findIndex function in c#. For example, array[2] = {4, 7, 8}. I know the value is 7, how do…
user1798299
  • 173
  • 2
  • 4
  • 12
9
votes
5 answers

Script to add an index on each foreign key?

Seeing as a foreign key does not automatically create an index in SQL Server, I want to create an explicit index on every FK field in my database. And I have over 100 tables in the schema... So, does anyone have a ready packaged script that I could…
Shaul Behr
  • 36,951
  • 69
  • 249
  • 387
9
votes
4 answers

When dropping a constraint will the supporting indexes also be dropped?

I am trying to memorize some sql syntax and I have gotten the ALTER TABLE ADD CONSTRAINT syntax down. I believe I am correct when I say that when you use this syntax to add a FOREIGN KEY or PRIMARY KEY constraint, that sql server automatically…
Seth Spearman
  • 6,710
  • 16
  • 60
  • 105
9
votes
1 answer

Is it a correct way to index TEXT column of MySQL database?

I have a map from strings to integers. To store this map in a MySQL database I created the following table: CREATE TABLE map( Argument TEXT NOT NULL, Image INTEGER NOT NULL ) I chose the TEXT type for the argument because its length is…
Rystsov Denis
  • 91
  • 1
  • 3
9
votes
3 answers

Titan vertex centric indices vs Neo4j labels

I was trying to make a comparison between these two technologies when approaching this and I was wondering if any of you already have some experience dealing with any or both of them? I am mainly interested in performance numbers when dealing with…
ppareja
  • 730
  • 1
  • 5
  • 16
9
votes
1 answer

Using indexes with NVarchar(50) vs. NVarchar(255) column?

We have an indexed column (ModelName) which has a big importance in the table and is very similar to a "Catalog Number", but it's not the PK. a lot of ORDER by ModelName ; WHERE ModelName etc, is being used. The column originally started as …
ZigiZ
  • 2,480
  • 4
  • 25
  • 41
9
votes
3 answers

List operations related to another list's conditions

I have two lists like these: public static List>> listQ = new List>>(); public static List>> listVal = new List >>(); 2 list also have same size. I want some operations in…
1teamsah
  • 1,863
  • 3
  • 23
  • 43
9
votes
1 answer

rbind `data.tables` and preserve key

I'm looking for behavior similar to inserting into an already keyed SQL table, where the new rows added are inserted into existing keys. For example, in this case: dt <- data.table(a=1:10) setkey(dt, a) tables() # NAME NROW MB COLS KEY # [1,]…
BrodieG
  • 51,669
  • 9
  • 93
  • 146
9
votes
2 answers

Retroactive indexing in Google Cloud Datastore

There are many properties in my model that I currently don't need indexed but can imagine I might want indexed at some unknown point in the future. If I explicitly set indexed=False for a property now but change my mind down the road, will…
rusty1042
  • 267
  • 2
  • 3
  • 12
9
votes
7 answers

Storing large amounts of data: DB or File System?

Let's say my application creates, stores and retrieves a very large amount of entries (tens of millions). Each entry has variable number of different data (for example, some entries have only a few bytes such as ID/title, while some may have…
mvbl fst
  • 5,213
  • 8
  • 42
  • 59
9
votes
3 answers

Efficient method to subset drop rows with NA values in R

Background Before running a stepwise model selection, I need to remove missing values for any of my model terms. With quite a few terms in my model, there are therefore quite a few vectors that I need to look in for NA values (and drop any rows that…
Oreotrephes
  • 447
  • 1
  • 4
  • 10
9
votes
4 answers

SQL Server - how to determine if indexes aren't being used?

I have a high-demand transactional database that I think is over-indexed. Originally, it didn't have any indexes at all, so adding some for common processes made a huge difference. However, over time, we've created indexes to speed up individual…
SqlRyan
  • 33,116
  • 33
  • 114
  • 199
9
votes
4 answers

PHP: is there difference between Index, Element, Key, Value of an Array?... are they the same thing?

When dealing with PHP arrays, I quite often here terms such as: Array Key, Array Index, Array Element, Array Value Can someone, PLEASE , in simple terms explain what each of these basically means? Is there any difference?... are they all referring…
Universal Grasp
  • 1,835
  • 3
  • 20
  • 29
9
votes
1 answer

Disadvantages of many indexes in MySQL

Situation I have a table called follow and this is the table structure: - follower_id - following_id - when // timestamp These are the SQL Queries I execute: SELECT * FROM follow WHERE follower_id = ? ORDER BY when LIMIT 0,20 SELECT * FROM follow…
Can Geliş
  • 1,454
  • 2
  • 10
  • 19
1 2 3
99
100