index

How MongoDB manage secondary indexes scans?

By default MongoDB creates index on _id key in document. But when I ensure additional index (secondary like in InnoDB from MySQL?) and query it after, engine scans it and then selective scan _id index to get documments offsets? I'm confused because when sharding comes it I'm right every chunk have own indexes and there will be many rand...

SQL Server does not use an index comparing datetime to not null

Hello, I have a simple table not related to any other. It has a not PK column that it is a date. I have created a non-clustered index to that column. If I make this query: select * from table where datecolumn is not null <-- does not use the index and goes really slow. But if I remove the not, this way: select * from table where datec...

Single Pages loading with index.php instead of single.php in wordpress

My single pages and posts are not being loaded by single.php, instead they are being loaded in index.php I'm not able to figure out the reason for this. My is a template which I have made myself and the loop in index.php is almost the same in the default theme of wordpress 3. This is creating lots of troubles for me. What could be the ...

Google SEO indexing of the url

Say if i have www.xxx.com/origin-to-destination/date/time , will google index www.xxx.com/origin-to-destination or www.xxx.com/origin-to-destination/date/time or both ...

Mysql, does using index for selects with operators >,< improve performance?

I need to select a row from table that has more than 5 millions of rows. It is table of all IP ranges. Every row has columns upperbound and lowerbound. All are bigintegers, and the number is integer representation of IP address. The select is: select * from iptocity where lowerbound < 3529167967 and upperbound >= 3529167967 ...

Is MySQL index_length in bytes?

The MySQL documentation defines index_length as "The length of the index file" but doesn't specify the unit. Is it bytes? http://dev.mysql.com/doc/refman/5.1/en/show-table-status.html ...

How to access the first character of a character array?

#include <stdio.h> int main(void){ char x [] = "hello world."; printf("%s \n", &x[0]); return 0; } The above code prints out "hello world." How would i print out just "h"? Shouldn't the access x[0] ensure this? ...

How to index a lookup table in MySQL

I have a 10M-row table product with fields like color (int), price (float), weight (float), unitprice (int), etc ... Now users from Web dynamically generate queries to lookup data from this table with random conditions (color is a must have here) and order-by such as select * from product where color=1 and price >5 and price <220 and .....

Dissallow robots for a while

I'm will be hosting a wordpress site on a live server. But it will be in test phase for while. How can I tell the robots not to index the site till then? ...

Indexing with Masked Arrays in numpy

I have a bit of code that attempts to find the contents of an array at indices specified by another, that may specify indices that are out of range of the former array. input = np.arange(0, 5) indices = np.array([0, 1, 2, 99]) What I want to do is this: print input[indices] and get [0 1 2] But this yields an exception (as exp...

How do I replicate a webserver's directory listing functionality?

I am often tasked with making specialty websites for the professors at my university. Recently a professor asked me to create a site with nothing except links to files. I told him that would be easy because as long as the site didn't include an index all the file links would display automagically (yeah I did). To my dismay the univers...

Ruby Rack - mounting a simple web server that reads index.html as default

Hello, I'm trying to get some information from this tutorial: http://m.onkey.org/2008/11/18/ruby-on-rack-2-rack-builder basically I want to have a file config.ru that tell rack to read the current directory so I can access all the files just like a simple apache server and also read the default root with the index.html file...is there a...

SQL Server 2005 Index rebuild when increasing the size of a varchar field

I have a 12 varchar(50) fields in a table of about 90 million rows that I need to increase to varchar(100) in length. Each of these fields has an index (with only the one field as a member). If I increase the length of the varchar fields, will the indexes either need to be rebuilt (or would be rebuilt automatically), or would the stati...

index out of range exception when storing into asp.net session

Please bare with me, I'm very new to asp.net. I'm building a web app that to build a report, but there are too many arguments to give each one a name, and I want to save them indexed by numbers so I can handle them with loops later on throughout the application. However, I'm getting an index out of range on the very first session item(...

Creating index/pk in a huge table is taking too long. I am using Oracle. How do I know if it is going well?

Hi, I have a really huge table, with ~200 million rows. It had no index/pk at all. Selects in this table were (obviously) running slow. I decided to create a PK using 3 columns. I did it in a test environment that has a smaller version of this table and it worked like a charm. So, before going home i did a ALTER TABLE HUGETABLE ADD CO...

Composite Index vs. INCLUDE Covering Index in SQL Server

Hi Folks I understand that Composite Indexes are always used Left to Right (e.g. if an Index was on City, State, WHERE City = "Blah" or WHERE City = "Blah" AND State = "AA" would work fine but WHERE State = "AA" would not). Does this same principle apply to INCLUDE indexes? Thanks in advance! Clay ...

What indexes will I need to make on this SQL Server table?

Hi folks, I have the following sql query for a SQL Server 2008 db. SELECT TOP(@NumberOfStreetResults) LocationType, LocationId, Name FROM [dbo].[LocationNames] WHERE CONTAINS(Name, @SearchQuery) AND LocationType = 7 Notice how I'm using the CONTAINS keyword? I have an FTS on the Name field. I'm not sure what index(s) I need to ...

Inverse index binary format

Hi i'm trying to figure out what kind of binary file can support my needs for inverse index. Let say that i have document that i can identify with unique ID and each document can have 360 fixed values in range of 0-65535. Something like this: Document0: [1, 10, 123, ...] // 360 values Document1: [1, 10, 345, ...] // 360 values Now, i...

Index time boosting is not working with boosting value in document level

We are having 10 documents (all 10 documents with name_s="john" or name_s="john abraham") with boosting value 10.0 in doc level out of 100 documents. DataImportHandler is used to index the documents in xml. We gave omitNorms="false" in a field called "text" and having schema.xml configured as below. Default query field is "text", when i ...

MongoDB's geospatial index: how fast is it?

I'm doing a where in box query on a collection of ~40K documents. The query takes ~0.3s and fetching documents takes ~0.6 seconds (there are ~10K documents in the result set). The documents are fairly small (~100 bytes each) and I limit the result to return the lat/lon only. It seems very slow. Is this about right or am I doing somethi...