indexing

Is it possible to set an index inside a XML column on SQL Server 2005 / SQL Server 2008?

Hi, I have an application that stores xml documents inside a column on SQL Server. The structure of the XML document is similar to the one below: <document> <item> ... <phoneNumber>0123456789</phoneNumber> .... </item> <item> ... <phoneNumber>9876543210</phoneNumber> .... ...

Search a large file for data in C/C++

Hi all, I have a log file which has a format of this kind: DATE-TIME ### attribute1 ### attribute2 ###attribute3 I have to search this log file for a input attribute(entered from command line) and output the lines that match the entered attribute. A naive approach may be something like this: scan the entire file line by line searc...

The case of the Missing-Index-Not!

I ran the code found here: SQLServerPedia Find Missing Indexes (sic) and it reported an index missing (one column in the equality column, none in the inequality column, and none in the included column). However, this index already exists! I've updated stats on the index, on the table, dropped and recreated the index in question, run sp_...

phpMyAdmin is asking what size a new index should be for a varchar field with 255 characters.

Hi folks - a newbie question, with apologies. I have a table with only 14,500 rows, which is not likely to increase much over time. I'm trying to index one field to enable fulltext searching, and phyMyAdmin is asking me to enter a size for the index. I have no idea what this number should be, or indeed how to look up the answer. Thanks. ...

Cluster the index on ever-increasing datetime column on logging table?

I'm not a DBA ("Good!", you'll be thinking in a moment.) I have a table of logging data with these characteristics and usage patterns: A datetime column for storing log timestamps whose value is ever-increasing and mostly (but only mostly) unique Frequent-ish inserts (say, a dozen a minute), only at the end of the timestamp range (new...

Django db_index issue

Currently, I have 3 models, A, B and C C has foreign key to B B has foreign key to A class C(models.Model): name = models.CharField(max_length=50, db_index=True, unique=True) b = models.ForeignKey(B) class B: ...similar to C class A ...similar to C except for the FK However, the SQL generated by manage.py sqlindexes app doesn...

How to rebuild a BST from a file

My C++ program creates an unbalanced BST from user input, and saves it do disk. It does this by first indexing each node by doing a pre-order traversal and assigning each node a unique number. Next, it outputs the BST to a file. It does this by doing a pre-order traversal and then for each node printing to file the data value, the ind...

AND statement for multiple columns in fulltext index

I have a fulltext indexed table and try to query for results matching multiple words. E.g. I have a address table with the indexed columns address_text, zip_code and city. | ROW | address_text | zip_code | city | | 1 | Bourbon street | 1234 | Baltimore | | 2 | Bourbon street | 1234 | New Orleans| Now I want t...

Is there a way to list the properties of an indexing catalog?

I wanted to get list of properties for an Microsoft indexing catalog. Is there a way? If yes how can it be done..? I use C# 3.5 ...

What is a SPATIAL INDEX and when should I use it?

Like most of the average PHP web developers I use MySql as a RDBMS. MySql (as other RDBMS also) offers SPATIAL INDEZ features, but I'm don't get it very well. I goole for it but I don't found clear real world examples to clearify my bad knowledge about it. Could someone explain me a little bit what is a SPATIAL INDEX and when should I u...

What does this sentence mean: Clustered indexes are stored physically on the table?

How are clustered indexes stored on a hard disk? What is the logical order? How do non-clustered indexes work? ...

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 unpredictable, currently the longest record has 2290 chars and the average length is 88 chars. ...

why a code inside tableview is repeating 4 times for each row?

I have a variable called "conteggio" in my code, you can see it below... this variable have to increase of 1 at every row of my tableview... when i try to do this i receive a result like: 4,8,12,16,etc. multiples of 4 for each row... it seems that it repeat the code 4 times for each row. And if i scroll back and forth my table those num...

Indexed full text search in Eclipse?

Is it possible (via a plugin or other way) for Eclipse to build a full text index for a project, so that searching a String does not linearly search all the files in the project? (or does it automatically build such an index to speed up future searches?) ...

Why is my index not used for this SELECT DISTINCT query on a text column?

I expected either index to be used for my SELECT DISTINCT query below: CREATE TABLE test( value TEXT ); INSERT INTO test (value) VALUES ('a'); INSERT INTO test (value) VALUES ('b'); INSERT INTO test (value) VALUES ('c'); CREATE INDEX value_i ON test(value(32)); CREATE FULLTEXT INDEX value_i_ft ON test(value); SELECT DISTINCT value ...

Java Array Indexing

class anEvent{ String number; String dueTime; } public static void main(String args[]) { int x = args.length / 2; int y = args.length; anEvent [] order = new anEvent [x]; for(int i=0; i<x; i++){ if(i==0){ order[i].number = args[0]; //Line(#) order[i].dueTime = args[1]; } ...

Best data structure for crossword puzzle search

I have a large database for solving crossword puzzles, consisting of a word and a description. My application allows searching for words of a specific length and characters on specific positions (this is done the hard way ... go through all words and check each). Plus a search by description (if necessary) For instance find word _ _ A _...

Change a Primary Key from Nonclustered to Clustered

Suppose I have an SQL Server 2005 table, TableX, with 2 indexes on it: PK_TableX = PRIMARY KEY NONCLUSTERED on FieldA IX_TableX_FieldB = CLUSTERED on FieldB I want to switch the PK to be CLUSTERED, and the other index to be NONCLUSTERED. I have to assume that the database will be in use at the moment I try to change the indexes round...

Entity Framework Code Generation with Indexes

Is there a way to tell .NET 4 ADO.NET Entity's SQL Generator to create indexes for a specific column? ...

python: dictionary dilemma: how to properly index objects based on an attribute

first, an example: given a bunch of Person objects with various attributes (name, ssn, phone, email address, credit card #, etc.) now imagine the following simple website: uses a person's email address as unique login name lets users edit their attributes (including their email address) if this website ha...