index

Do make indexes containing another index make sense?

Given a table (id, col1, col2), does it make sense to create the following indexes: Index1 (col1) not unique Index2 (col1, col2) not unique I am faced with a legacy database that is full of those. Can I safely delete Index1? Anwser needed for SQL Server and Oracle. ...

PostgreSQL - CREATE INDEX

Hi! I'm working with PostgreSQL to create some data types written in C. For example, I have: typedef struct Point3D { char id[50]; double x; double y; double z; } Point3D; The input and output functions are working properly. But the problem is the following: Every id of Point3D must be unique (and can be NULL), so I ...

Does Google index HTTPS ASP.NET pages?

I have an online application that all of its pages use HTTPS. I have 3 questions: Does Google index HTTPS pages? I have a password protected single ASP.NET page (using HTTPS). Password protection is basically achieved by a Session object. When the correct password is entered, it hides the login panel and displays the same page which ha...

Is it possble to create an index on index ?

This is a multipart Indes question: Is there a way one can create index on index? Why would one wish to to so? And if so, are ther any examples? ...

How to implement this feature in javascript ? Make uncertain , divorce, the wife say!

In the Javascript, could I define a class, the class itself can also when a function call, similar to the index, such as: function A() { } var a=new A(); var v=a(); //Use ordinary/like Javascript function use ...

jquery get the index of a row?

Even this isn't working.... $("table#mytable > tbody > tr").each(function(index) { if($(this).attr('id','firstrow')) { $("input[name^=f1]").focus(function() { var newRow = '<tr><td></td><td></td></tr>'; $("tbody").append(newRow); }); } else { $("input[name^=f2]").focus(fu...

C - how to convert a pointer in an array to an index?

In the many search functions of C (bsearch comes to mind) if a result is found, a pointer to the spot in the array is returned. How can I convert this pointer to the index in the array that was searched (using pointer arithmetic, i assume). ...

oracle select query - index on multiple columns

Hello. I'm working on a sql query, and trying to optimise it, because it takes too long to execute. I have a few select and UNION between. Every select is on the same table but with different condition in WHERE clause. Basically I have allways something like : select * from A where field1 <=TO_DATE ('01/01/2010', 'DD/MM/YYYY') AND fie...

Passing Index Ranges

I'm currently trying to figure out how to pass an index range as a string, but so far have not been having any luck. Here is an example of what I'm trying to do: pos = %w{1 2..4} values = %{x cat} test_string = "This is a test with a string." test_string[pos[1]] = values[1] I know I could just break it down with split or something s...

Creating SQL Server index on a nvarchar column

When I run this SQL statement: CREATE UNIQUE INDEX WordsIndex ON Words (Word ASC); I get the following exception message: The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.Words' and the index name 'WordsIndex'. The duplicate key value is (ass). The statement has been term...

oracle drop index if exits

How do you drop an index only if it exists? It seems simple but I did found anything on the net. The idea is to drop it only if it exists, because if not, I will have an error and my process stops. I found this to find if the index exists: select index_name from user_indexes where table_name = 'myTable' and index_name='myIndexName' ...

SQL Server 2005 Performance Dashboard Missing Index

I am using the performance dashboard with our SQL Server 2005 databases and it lists what it considers to be missing indexes. But some of those indexes DO exist! They are not disabled, and they are defined exactly as the dashboard says they should be. Why are they reported as missing? ...

Javascript replace content of string but not in start and end tag? pls help

Hi all i need your help ! i wanna write javascript function to change the text Lasvegas in string: ex: "Hello every one in Lasvegas, come <a href='xxx'>Lasvegas</a> with me" How can i change the text but not change content Lasvegas in start tag and end tag ...

MATLAB expression column indexing

I have an expression that gives a matrix and I want to access an element, without creating a temporary variable, something like this cov(M)(1,1). How can I do it? Thanks! ...

SQL Server Clustered Index: (Physical) Data Page Order

I am struggling understanding what a clustered index in SQL Server 2005 is. I read the MSDN article Clustered Index Structures (among other things) but I am still unsure if I understand it correctly. The (main) question is: what happens if I insert a row (with a "low" key) into a table with a clustered index? The above mentioned MSDN a...

How can I get a COUNT(col) ... GROUP BY to use an index?

I've got a table (col1, col2, ...) with an index on (col1, col2, ...). The table has got millions of rows in it, and I want to run a query: SELECT col1, COUNT(col2) WHERE col1 NOT IN (<couple of exclusions>) GROUP BY col1 Unfortunately, this is resulting in a full table scan of the table, which takes upwards of a minute. Is there any...

Resuming MySQL indexing

Hello All, I have been building index on a 200 million row table for almost 14 hours. Due to resource over-consumption on the machine (because of a separate incident), the machine cashed. Clearly, I want to avoid another 14 hours to re-construct the index. Is there a way that I can resume the construction of index from the point (or sli...

Should I create a unique clustered index, or non-unique clustered index on this SQL 2005 table?

I have a table storing millions of rows. It looks something like this: Table_Docs ID, Bigint (Identity col) OutputFileID, int Sequence, int …(many other fields) We find ourselves in a situation where the developer who designed it made the OutputFileID the clustered index. It is not unique. There can be thousands of records with this I...

How to "defragment" MongoDB index effectively in production?

I've been looking at MongoDB. Feels good. I added some indexes to a collection, uploaded a bunch of data, then removed all the data, and I noticed the indexes did not change size, similar to the behavior reported here. If I call db.repairDatabase() the indexes are then squashed to near-zero. Similarly if I don't remove all the d...

In Python, how can I find the index of the first item in a list that is NOT some value?

Python's list type has an index(x) method. It takes a single parameter x, and returns the (integer) index of the first item in the list that has the value x. Basically, I need to invert the index(x) method. I need to get the index of the first value in a list that does NOT have the value x. I would probably be able to even just use a fu...