index

array_merge vs array_value for resetting array index

I have 1 array that I want to re-index. I have found that both array_values and array_merge functions can do the job (and I don't need 2 arrays for the array_merge function to work). Which is faster for a very large array? I would benchmark this, but I don't know how and don't have the large array yet. Before re-index: Array ( [0...

Drupal - Hide a single page from search index

Hi, I've taken over an existing Drupal installation and have been asked to remove a single page from the site search results. I know about the lullabot tutorial through this question: http://stackoverflow.com/questions/1748837/hide-drupal-nodes-from-search, but that talks about excluding a class of content when I really just want to excl...

simple question about oracle indexes

If I have an oracle query like below: SELECT * FROM table_a where A = "1", B = "2", C = "3" for this query to pickup one of the indexes of table_a...does the index need to be on all 3 of these columns? What I am asking is: What if Index is on A, B, C, D? What if Index is on B, C? Will the index only be picked when it is on A, B, C?...

How to roll my own index in c#?

I need a faster way to create an index file. The application generates pairs of items to be indexed. I currently add each pair as it is generated to a sorted dictionary and then write it out to a disk file. This works well until the number of items added exceeds one million, at which time it slows to the point that is unacceptable. Ther...

How to set index on the column which have datatype varchar(4096) in SQL Server 2005?

This is the query for creating index create index idx_ncl_2 on BFPRODATTRASSOCIATION (value,attributeid) include (productid) Table structure of BFPRODATTRASSOCIATION ProdAttrAssociationId bigint no 8 ProductId bigint no 8 AttributeId bigint no 8 Value varchar no 4096 I am getting this error: T...

Databases and B+Trees indexes

Where can I find information on whether which databases are using B+Trees over B-Trees for their index implementations? Oracle appears to be using B+Trees. Although they don't describe it on their documentation, their graphics appear to be pointing that B+Trees are actually being used. ...

MySQL Index Structure: multiple or single index?

Hi, I have question about database optimizing, indexing. I have table that called "projects" and i will execute queries like this: Ordering Queries SELECT * FROM projects WHERE active = 1 ORDER BY created SELECT * FROM projects WHERE active = 1 ORDER BY project_deadtime SELECT * FROM projects WHERE active = 1 ORDER BY project_allowed...

Mysql: Unique Index = Performance Characteristics for large datasets?

Hello Experts, what is the performance characteristic for Unique Indexes in Mysql and Indexes in general in MySQl (like the Primary Key Index): Given i will insert or update a record in my databse: Will the speed of updating the record (=building/updating the indexes) be different if the table has 10 Thousand records compared to 100 Mi...

foreign key and index issue

Hello everyone, I am using SQL Server 2008 Enterprise. I have a table and one of its column is referring to another column in another table (in the same database) as foreign key, here is the related SQL statement, in more details, column [AnotherID] in table [Foo] refers to another table [Goo]'s column [GID] as foreign key. [GID] is pri...

Index files for Subdomains

I was finally able to setup subdomains but now I have a problem when I try and access the subdomain by itself. For instance, when I visit sub.domain.com, I get a page not found error. However, when I visit sub.domain.com/index.php, I see my page. My theory is that when I visit sub.domain.com, the index file it searches for is not in the...

how can i query a table that got split to 2 smaller tables? Union? view ?

hello friends, I have a very big table (nearly 2,000,000 records) that got split to 2 smaller tables. one table contains only records from last week and the other contains all the rest (which is a lot...) now i got some Stored Procedures / Functions that used to query the big table before it got split. i still need them to query the u...

Django URL user id versus userprofile id problem

I have a mini comunity where each user can search and find another user's profile. Userprofile is a class model, indexed differently compared to user model class (user id is not equal to userprofile id). But I cannot see a user profile by typing in the URL the corresponding id. I only see the profile of the currently logged in user. Wh...

Tracking Maintainability index (MI) in Java

Hi I need a good fast, reliable (open source would be a plus) tool for Java for tracking Maintainability index and simliar code metrics to show the customer the progress of working on refactoring issues. What would be your suggestion to apply? ...

Can this be done in 1 line?

Can this be done in 1 line with PHP? Would be awesome if it could: $out = array("foo","bar"); echo $out[0]; Something such as: echo array("foo","bar")[0]; Unfortunately that's not possible. Would it be possible like this? So I can do this for example in 1 line: echo array(rand(1,100), rand(1000,2000))[rand(0,1)]; So let's say ...

How to add indexes to MySQL tables?

I've got a very large MySQL table with about 150,000 rows of data. Currently, when I try and run SELECT * FROM table WHERE id = '1'; the code runs fine as the ID field is the primary index. However, recently for a development in the project, I have to search the database by another field. For example SELECT * FROM table WHERE produc...

Solr spellcheck configuration

I am trying to build the spellcheck index with IndexBasedSpellChecker <lst name="spellchecker"> <str name="name">default</str> <str name="field">text</str> <str name="spellcheckIndexDir">./spellchecker</str> </lst> And I want to specify the dynamic field "*_text" as the field option: <dynamicField name="*_text" stored="false" t...

Thinking Sphinx - shows false positives even though delta indexing is used

This may have to do with Sphinx rather than Thinking Sphinx. I am using delta indexes. Lets say a record has text field contains word 'foo' Full indexing is done word 'foo' is removed from the record delta indexing is done Search for 'foo' The above record is returned even though it doesn't contain word 'foo' Expected Result: Above r...

noindex, follow on list views?

On one of our client's website we have lot's of list views with links to detail views. (Image a blog with the posts overview and the single pages). The detail views don't change, but the list views will change when new items come up. The pages displaying the list view don't contain any other valuable content. So my question is: Does it...

Using an index to get an item, Python

I have a list in python ('A','B','C','D','E'), how do I get which item is under a particular index number? Example: Say it was given 0, it would return A. Given 2, it would return C. Given 4, it would return E. ...

2-column table with two foreign keys. Performance/design question.

Hello everyone! I recently ran into a quite complex problem and after looking around a lot I couldn't find a solution to it. I've found answers to my questions many times before on stackoverflow.com, so I decided to post here. So I'm making a user/group managment system for a web-based project, and I'm storing all related data into a p...