index

MySQL won't use index for query?

I have this table: CREATE TABLE `point` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `siteid` INT(11) NOT NULL, ...

Can there be TEXT/BLOB columns in a table without filesort in MySQL?

Hi, I'm working on a database program and I noticed that when I'm doing queries with tables that have TEXT/BLOB columns, MySQL will use temp tables and use filesort. I'm not entirely sure when and how this happens, but are there cases where MySQL does not use filesort when there are BLOB/TEXT columns? Like if the sort column is type of ...

SQL Server Index cost

I have read that one of the tradeoffs for adding table indexes in SQL Server is the increased cost of insert/update/delete queries to benefit the performance of select queries. I can conceptually understand what happens in the case of an insert because SQL Server has to write entries into each index matching the new rows, but update and...

Strange use of the index in Mysql

Explain SELECT `feed_objects`.* FROM `feed_objects` WHERE (`feed_objects`.feed_id IN ( 165,160,159,158,157,153,152,151,150,149,148,147,129,128,127,126,125,124,122, 121, 120,119,118,117,116,115,114,113,111,110)) ; +----+-------------+--------------+------+---------------+------+---------+------+------+-------------+ | id | select_t...

Google index vs asp.net url routing

I've made the change from querystring asp.net webforms application to an url routing one. Now I'm trying to let google know that there's a new set of urls to be aware of. The G has indexed 133 out of 179 new urls sent in sitemap.xml, but the site:mistral.hr command returns the old querystring version of the links. This could partly be so...

[C++] Index strings by other strings

Hello, I need to index specific strings with other strings and I can't really find a good way to do so. I tried to use tr1::unordered_map, but I'm having some difficulties using it. If someone could tell me what is the best way to do that I'd be really grateful :) I also need to index objects by a number (numbers are not in order so I ca...

text indexes vs integer indexes in mysql

Hey, I have always tried to have an integer primary key on a table no matter what. But now I am questioning if this is always necessary. Let's say I have a product table and each product has a globally unique SKU number - that would be a string of say 8-16 characters. Why not make this the PK? Typically I would make this field a uni...

Index of elements, jQuery or Javascript

I've a table that contains 3 columns. I need to bind an event that fires off whenever one of those columns is clicked using jQuery. However, I need to know the index of the column clicked. i.e: First column (index 0), Second column (index 1), Third column (index 2), and so on... How can I do that? var firstRow: var firstRow = $("tr:...

mysql index optimization for a table with multiple indexes that index some of the same columns

I have a table that stores some basic data about visitor sessions on third party web sites. This is its structure: id, site_id, unixtime, unixtime_last, ip_address, uid There are four indexes: id, site_id/unixtime, site_id/ip_address, and site_id/uid There are many different types of ways that we query this table, and all of them are...

Finding indexes of each element in a multidimensional array in ruby

Eg :a=[["hello", "world"], ["good", "lord"], ["hello", "lord"]] I need to find and record the indexes of each word with respect to the super-array. i.e hello => 0,2 world => 0 lord => 1,2. here's my shot ,but its very amateurish and lengthy. all_tokens=tokens.flatten all_tokens.each do|keyword| ...

sql server 2005 indexes and low cardinality

How does SQL Server determine whether a table column has low cardinality? The reason I ask is because query optimizer would most probably not use an index on a gender column (values 'm' and 'f'). However how would it determine the cardinality of the gender column to come to that decision? On top of this, if in the unlikely event that I...

Determine if a PHP array uses keys or indices

How do I find out if a PHP array was built like this: array('First', 'Second', 'Third'); Or like this: array('first' => 'First', 'second' => 'Second', 'third' => 'Third'); ??? ...

How can I find the maximum or minimum of a multi-dimensional matrix in MATLAB?

I have a 4D array of measurements in MATLAB. Each dimension represents a different parameter for the measurement. I want to find the maximum and minimum value and the index (i.e. which parameter) of each. What's the best way to do it? I figure I can take the max of the max of the max in each dimension, but that seems like a kludge. ...

VB.NET: I Cant find the index of an array

This is the code for my array (which is working) Public numUsers As Integer Public fNameUsers As String = ("..\..\..\users.txt") Public UserRecords As Usersclass() 'note... this line is in a module ' reader = New System.IO.StreamReader(fNameUsers) numUsers = 0 'Split the array up at each delimiter of "," and add new objects ' ...

Indexing SET field

I have two entities A and B. They are related with many to many relation. Entity A can be related up to 100 B entities. Entity B can be related up to 10000 A entities. I need quick way to select for example 30 A entities, that have relation with specified B entities, filtered and sorted by different attributes. Here how I see ideal solu...

Double linking array in Python

Since I'm pretty new this question'll certainly sound stupid but I have no idea about how to approach this. I'm trying take a list of nodes and for each of the nodes I want to create an array of predecessors and successors in the ordered array of all nodes. Currently my code looks like this: nodes = self.peers.keys() nodes.sor...

How to put overlay NSImageView and keep it at the top of a WebView?

How to put overlay view (NSImageView) and keep it at the top in front of a WebView ( which runs core animation or )? Standard ordering in interface builder does not help.. imageview is shown in front of the webview but when i load the contents of webview with a tag or only just an html opacity animation, suddently webview takeovers t...

Finding position of each word in a sub-array of a multidimensional array

I have an array: tokens = [["hello","world"],["hello","ruby"]] all_tokens = tokens.flatten.uniq # all_tokens=["hello","world","ruby"] Now I need to create two arrays corresponding to all_tokens, where the first array will contain the position of each word in sub-array of tokens. I.E Output: [[0,0],[1],[1]] # (w.r.t all_tokens) To m...

PHP: How can i convert an index to an string ?

Hi, how can i convert an index to an string ? For example i would like to get the 'signin' index here: array(1) { ["signin"]=> array(2) { ["email_address"]=> string(0) "" ["password"]=> string(0) "" } } Javi ...

how to effectively modify index

Hej everyone, problem : I am looking for right way to convert an index from clustered to non-clustered Description : I have a table as below in sybase db: dbo.UserLog ------------------------ Id | UserId |time | .... ------------------------ This is hash partitioned using UserId. Currently it has 2 indexes UserId : non-clustered...