An index is a data structure that facilitates a faster lookup time.
3
votes
2answers
738 views
DOs and DONTs for Indexes [closed]
What are some DOs and DONTs for improving database performance using index?
A DO would be a case in which an index should be created, or another indexes related tip that will improve performance.
A ...
3
votes
3answers
4k views
Mysql::Error: Specified key was too long; max key length is 1000 bytes
script/generate acts_as_taggable_on_migration
rake db:migrate
causes
Mysql::Error: Specified key was too long; max key length is 1000 bytes: CREATE INDEX ...
34
votes
3answers
16k views
SQL join: selecting the last records in a one-to-many relationship
Suppose I have a table of customers and a table of purchases. Each purchase belongs to one customer. I want to get a list of all customers along with their last purchase in one SELECT statement. What ...
2
votes
6answers
572 views
Should every User Table have a Clustered Index?
Recently I found a couple of tables in a Database with no Clustered Indexes defined.
But there are non-clustered indexes defined, so they are on HEAP.
On analysis I found that select statements ...
1
vote
2answers
3k views
Get highest frequency terms from Lucene index
i need to extract terms with highest frequencies from several lucene indexes, to use them for some semantic analysis.
So, I want to get maybe top 30 most occuring terms(still did not decide on ...
12
votes
5answers
7k views
How to Remove Array Element and Then Re-Index Array?
I have some troubles with an array. I have one array that I want to modify like below. I want to remove element (elements) of it by index and then re-index array. Is it possible?
$foo = array(
...
9
votes
4answers
2k views
sql primary key integer/varchar
I had an argue at the office with the team I'm working with.
they decided to create a table with a varchar primary key. This table is referenced by another table on this primary key.
When I noticed ...
6
votes
2answers
3k views
MySQL load data infile - acceleration?
sometimes, I have to re-import data for a project, thus reading about 3.6 million rows into a MySQL table (currently InnoDB, but I am actually not really limited to this engine). "Load data infile..." ...
18
votes
6answers
19k views
Java - replace a character at a specific index in a string?
I'm new to Java and I'm trying to replace a character at a specific index in a string. What I'm doing is:
String myName = "domanokz";
myName.charAt(4) = 'x';
this gives me error. It seems like ...
4
votes
3answers
2k views
Is it possible to change the analyzer specified in the schema in Solr without reindexing from the original source?
In Solr, if we have a field in the schema with stored="true", and we change the analyzer associated with that field, is it possible to update just this field without reindexing all the documents? ...
4
votes
3answers
682 views
T-SQL for finding Redundant Indexes
Is anyone aware of a T-SQL script that can detect redundant indexes across an entire database? An example of a redundant index in a table would be as follows:
Index 1: 'ColumnA', 'ColumnB', 'ColumnC'
...
4
votes
1answer
2k views
Linq to SQL nvarchar problem
I have discovered a huge performance problem in Linq to SQL.
When selecting from a table using strings, the parameters passed to sql server are always nvarchar, even when the sql table is a varchar. ...
3
votes
1answer
144 views
how provide a vertex_index property for my graph
Since my graph use setS for vertex, I have to either provide a vertex_index property map for my graph, or give an explicit vertex_id argument to write_graphviz, to be able to use write_graphviz.
My ...
0
votes
3answers
467 views
Why/when/how is whole clustered index scan chosen rather than full table scan?
IMO, please correct me...
the leaf of clustered index contains the real table row, so full clustered index, with intermediate leaves, contain much more data than the full table(?)
Why/when/how is ...
7
votes
5answers
5k views
PHP get index of last inserted item in array
It's as easy as the title sounds; I need to get the index/key of the last inserted item. Why is this difficult? See the following two code samples:
$a=array();
echo 'res='.($a[]='aaa').' - ...