index

Rebuild InnoDB Index ONLINE to prevent timeouts?

When I update a particularly large table, the update times out because the table is locked while the indexes rebuild. Is there any way to rebuild the index ONLINE (i.e. Oracle) so the update does not timeout? ...

Sorting with indexes

My query returns a query result which appears to be sorted, though there is no order by statement available. This could be coz of the clustered index. Is it wise to depend upon index for sorting? Is it a best practice to rely on index for sorting? Thanks ...

Can't sort table with associative indexes

Hi, why I can't use table.sort to sort tables with associative indexes? ...

Creating an Extremely Large Index in Oracle

Can someone look at the linked reference and explain to me the precise statements to run? Oracle DBA's Guide: Creating a Large Index Here's what I came up with... CREATE TEMPORARY TABLESPACE ts_tmp TEMPFILE 'E:\temp01.dbf' SIZE 10000M REUSE AUTOEXTEND ON EXTENT MANAGEMENT LOCAL; ALTER USER me TEMPORARY TABLESPACE ts_tmp; CREATE UN...

SQL - ID is lost after performing MIN then GROUP BY

To simplify, if I had a table called 'employee': id INT NOT NULL PRIMARY KEY, salary FLOAT, department VARCHAR(255) I want to perform and query where I retrieve the minimum salary in each department. So my query is something like this: SELECT employee.ID, MIN(employee.salary), employee.department FROM employee GROUP BY employee.depar...

how to set base index in ublas matrix?

hello I have searched the web but could not find an answer. how do I have set base index in the matrix, such that indexes start from values other than zero? for example: A(-3:1) // Matlab/fortran equivalent A.reindex(-3); // boost multi-array equivalent thanks ...

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 is the best practice? Any advice on building indexes? Please use these table/column names in your answer: customer: id, name purchase: i...

How to create index for dynamic search strings

I have a little DB, for academic purpose only, and I have object tables at most. I've created a entity-relationship model (ERM) in Power Designer and the program, by default, creates index for the serial id's for each table. I want to know how do I use a index like that on a query.Say I would want to find a product by its id, but using...

Best way to handle list.index(might-not-exist) in python?

I have code which looks something like this: thing_index = thing_list.index(thing) otherfunction(thing_list, thing_index) ok so that's simplified but you get the idea. Now thing might not actually be in the list, in which case I want to pass -1 as thing_index. In other languages this is what you'd expect index() to return if it couldn...

Why can't indexed views have a MAX() aggregate?

I have been trying out a few index views and am impressed but I nearly always need a max or a min as well and can not understand why it doesn't work with these, can anyone explain why? I KNOW they are not allowed, I just can't understand why!!! Count etc. is allowed why not MIN/MAX, I'm looking for explanation... ...

Defining an index combining two tables with Djapian

hi, I've got the following Restaurant and Comment models. I'm doing full text search on some fields of the Restaurant model, as shown below in the RestaurantIndexer class. How can I do a full text search including the comments (i.e. a search returning Restaurant instances with the query contained in one or some fields defined in Restaur...

Can DataMapper properties appear in multiple composite indexes?

I found that this issue had been discussed in Ticket #58 of DataMapper, apparently way back in 2007, but I can't find how to do it in the latest version (dm-core-0.10.2). I want to define two composite indexes, each of which are partially based on a certain property. I was hoping I could do this... class Stat include DataMapper::Resou...

In Ruby, what is the cleanest way of obtaining the index of the largest value in an array?

If a is the array, I want a.index(a.max), but something more Ruby-like. It should be obvious, but I'm having trouble finding the answer at so and elsewhere. Obviously, I am new to Ruby. Cary ...

Receive index with jquery

while selecting the desired element is simple in jquery i haven't found one way to receive an elements index here's an example of what i want. $('#minia .holder a').click(function () { }) this function is used obviously to catch any clicks on one of thoose elements to catch that specific element I use $(this) now my question is how w...

In which cases will Oracle create indexes automatically?

As far as I know (this page) Oracle automatically creates an index for each UNIQUE or PRIMARY KEY declaration. Is this a complete list of cases when indexes are created automatically in Oracle? ...

Verifying goal setup properly in Google Analytic ($index = goal value)

I have Google Analytics setup with a goal. The goal has a Goal URL thankyou.html and a goal value of $1.00 When I check my content report should the $index value of my thankyou.html page be $1.00? ...

Index for BETWEEN operation in MySql

I have several tables in MySQL in wich are stored chronological data. I added covering index for this tables with date field in the end. In my queries i'm selecting data for some period using BETWEEN operation for date field. So my WHERE statement consists from all fields from covering index. When i'm executing EXPLAIN query in Extra co...

Add Core Data Index to certain Attributes via migration

For performance reasons, i want to set the Indexed Attribute to some of my entities. I created a new core data model version to perform the changes. Core Data detects the changes and migrates my model to the new version, however, NO INDEXES ARE GENERATED. If I recreate the database from scratch, the indexes are there. I checked with SQ...

ignore insert of rows that violate duplicate key index

I perform an insert as follows: INSERT INTO foo (a,b,c) SELECT x,y,z FROM fubar WHERE ... However, if some of the rows that are being inserted violate the duplicate key index on foo, I want the database to ignore those rows, and not insert them and continue inserting the other rows. The DB in question is Informix 11.5. Curre...

Is there an index on the primary key of a table?

Does having a primary key column mean there is an index on that column? If so, what kind of index is it? ...