indexing

Most approprieted index for short-lived columns

In my current project, some tables have a column named "changed", which indicates if the the current line had been changed since the last check. All the insert and update statements includes this column. Every hour, I run a schedulated task that queries all changed rows, do some stuff with those rows and then sets null to it's "changed"...

saving Btrees to a disk file and read it

I want to save a Btree(not sure a binary one) in a disk file. and then read it to the memory. some Level-order traversal may be a good way for a binary Btree. but if it is not a binary one. I build up the Btree from the leafnode to the rootnode in memory. I believe that I have to define some structures in the disk file and output the tre...

Unexpected table scan for id != id

One application causes a heavy load on our Sql Server 2005 database. We don't control the application that runs this query hundres of times a minute: select id,col1,col2,col3 from table where id != id Note the id != id, meaning a row is not equal to itself. Unsurprisingly, the result is always no rows found. However, Sql Server does a...

Can we make IS / ixsso.Query perform an AND query by default?

We are using the ixsso.Query object to access an indexing service catalogue through a ColdFusion script. We are currently having issues with structuring the query. The website has a single field free text input and assumes the user is entering the text in an unstructured form. We need to perform queries that ‘AND’ all the inputted keywo...

RDBS when to use complex indexes for queries and when use simple?

Suppose I have table in my DB schema called TEST with fields (id, name, address, phone, comments). Now, I know that I'm going to perform a large set of different queries for that table, therefore my question is next, when and why I shall create indexes like ID_NAME_INDX (index for id and name) and when it's more efficient to create separ...

is there a strategy for creating proper database indexes?

Someone asked the question: "INT, BIGINT or UUID/GUID in Oracle, DB2, Derby and HSQLDB?" and I started to think about all the database schemas I've designed and the books that I've read and not one reference gave any real clear advice about creating indexes. For example; if you have a compound index like date() ++ foo() ++ bar() Whil...

Descending sort order indexes

The Database Engine Tuning Advisor has finally given up the ghost and can't help me any more, so I'm having to learn a little bit more about indexes (shouldn't it be indices?). I think I'm more or less there. I know when to use composite indexes, what to include with my indexes, the difference between clustered and non-clustered indexe...

MySQL + Drupal: Index ignored in INNER JOIN

Our environment: Drupal+MySQL Examining the query log indicates that the following query, originating from Drupal core's node_load function is taking considerable amount of time. EXPLAIN on the node_load query reveals that the index is not used on the USER table. mysql> explain SELECT n.nid, n.vid, n.type, n.status, n.created, n.chang...

SharePoint 2007 -Content for this URL is excluded by the server because a no-index attribute

Did any of guys run into this error where the search crawler is ignoring an aspx page? I am getting the following warning message for these page: "Content for this URL is excluded by the server because a no-index attribute". Any help will be appreciated. Thanks. ...

Sql server function for displaying word frequency in a column

I have a table that lists a freet text input from a survey where enterents were allowed to enter their responses (regarding colours they would like to have in their wedding) I would like to write a sql function that gathers all the information from this column, and orders counts the frequency of each word, ordering the result set by thi...

MySQL query indexing with timestamp structure

Hi all, I was wondering what the best way of storing user queries correlated with timestamps in MySQL was. Let's say I have just two inputs, a user's "query" and "timestamp"... I could create a MySQL table with fields (id, query, count, timestamp_list), where: id is unique identifier of the query, query is the literal query string...

Does dropping a table in MySQL also drop the indexes?

It's not explicitly mentioned in the documentation (http://dev.mysql.com/doc/refman/6.0/en/drop-table.html). I ask because I just saw a curious database migration in a Rails project where the developer was removing all the indexes before dropping the table, and that seemed unnecessary. ...

Algorithm to find first index where strings are different?

I've got a collection of strings, and I need to know the first index where they all differ. I can think of two ways to do this: (the following pseudo code is just off the top of my head and may be heavily bug-laden) First Way: var minLength = [go through all strings finding min length]; var set = new set() for(i=0;i<minlength;i++) { ...

hw search substring in a list of indexed strings?

i am implementing dictionary in which key is a string keyword.suppose i have following keys in dictionary. mat**hon** sat**hon** lat**hon** now if i serach single keyword suppose mathon it will search it in constant time.but if i am to search hon i want all of three words to be retreived in constant time or minimum time possible like...

Oracle Large Table Search and DML

Hi I have three tables, t1, t2 and t3. 80% of the fields/columns are similar in these tables. Around 75,000 records are posted in table t1 and t2 on daily basis, totaling to 150,000. A process, say P123, is executed which moves 40-60 % records from t1 and t2 to t3 in a pair. The user searches frequently for records in all three tables wi...

Windows Indexing Service syntax

I am building an application over the Windows Indexing Service. The application is (among other things) used to search in text files containing IP addresses and textual data. When using the built-in "Indexing Service Query Form" in order to test the search capabilities, to search IP addresses, it returns non-relevant result. As far as I...

Using Indexable Properties in c#

I want to define some properties on a class using the [Indexable()] attribute in order to use the class with the i4o library (http://www.codeplex.com/i4o) but when I try and compile the code Visual Studio says it cannot find the Namespace for Indexable. Is this part of the CLR and which namespace/library do I need to get this to compile...

Performance of non-numeric indexes

If I use a nvarchar(n) column as a clustered index on a SQL Server database, am I going to suffer a significant performance hit compared to a numeric (int) index? Also how does the performance of compound indexes compare? ...

Sql Server: uniqueidentifier plus integer compound PK ... what type of index to use?

I have a junction table in my SQL Server 2005 database that consist of two columns: object_id (uniqueidentifier) property_id (integer) These values together make a compound primary key. What's the best way to create this PK index for SELECT performance? If the columns were two integers, I would just use a compound clustered index (...

Problematic delete with SQL index

I have some table: table ASK with idask table PREFERENCES with idpref, fk_idask, fk_idstructure table STRUCTURE with idstructure With all the constraint between the id and the fk_id and a unique index on the table PREFERENCES (fk_idask, fk_idstructure). The problem is when I have two row in PREFERENCES. `IDPREF` `FK_IDASK` `FK...