index

Rebuilding SQL Indexes - When?

When should one rebuild indexes? Nightly? Weekly? Hourly? ...

Url routing issue in asp.net mvc ...

I am doing a return RedirectToAction("Index", "Clients"); from my home controller.... It is fine but my url looks like http://localhost:1115/Clients/Index... How to remove index from url in asp.net mvc? Any suggestion.... My routes, public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resourc...

SQL indexes for "not equal" searches

The SQL index allows to find quickly a string which matches my query. Now, I have to search in a big table the strings which do not match. Of course, the normal index does not help and I have to do a slow sequential scan: essais=> \d phone_idx Index "public.phone_idx" Column | Type --------+------ phone | text btree, for table "publ...

htaccess to not show index.php in sub directory

I have a simple page structure like below /directory/subdir_1/index.php /directory/subdir_2/index.php .... (there are no other files in these directories) is it possible to have 'fake/pretty' urls for the above files as below? /directory/subdir_1 /directory/subdir_2 ... so this path would show whether the visitor typed that,/dir...

The IMPORTANCE of Indexes on Tables in SQL

I always knew proper indexes were important, but hadn't realized just HOW important until recently. We purchased an off-the-shelf eCommerce solution and implemented it. The SQL server CPU utilization would skyrocket to 99% when we hit about 600 concurrent users. After some investigation, I found that the Users table was NOT indexed prop...

How to create a non-unique index in sqlite?

How to create a non-unique index in sqlite? I'm using vb.net to create the tables. ...

When i should use primary key or index?

When i should use primary key or index? Which are the differences between primary key and index and which is the best? ...

Suggest Sphinx index scheme

Hi. In a MySQL database I have documents of different type: some have text content, meta keys, descriptions, others have code, SKU number, size and brand name and so on. The problem is, I have to search something in all of these documents and then display a single page, where the results will be grouped by the document type, such as help...

Scala create xhtml elements dynamically

Given a String list val www = List("http://bloomberg.com", "http://marketwatch.com"); I want to dynamically generate <span id="span1">http://bloomberg.com&lt;/span&gt; <span id="span2">http://marketwatch.com&lt;/span&gt; def genSpan(web: String) = <span id="span1"> + web + </span>; www.map(genSpan); // How can I pass the loop ind...

Which non-clustered index should I use?

Here I am studying nonclustered indexes on SQL Server Management Studio. I've created a table with more than 1 million records. This table has a primary key. CREATE TABLE [dbo].[Customers]( [CustomerId] [int] IDENTITY(1,1) NOT NULL, [CustomerName] [varchar](100) NOT NULL, [Deleted] [bit] NOT NULL, [Active] [bit] NOT N...

C# Lucene get all the index

Hello, I am working on a windows application using Lucene. I want to get all the indexed keywords and use them as a source for a auto-suggest on search field. How can I receive all the indexed keywords in Lucene? I am fairly new in C#. Code itself is appreciated. Thanks. ...

Why is postgresql update query so slow sometimes, even with index

i have a simple update query (foo column type is BOOLEAN (default false)): update tablename set foo = true where id = 234; which "id" is set to (primary) key, and if i run "explain analyze" i got: Index Cond: (id = 234) Total runtime: 0.358 ms but still, i have plenty of unexplained queries at slow log (pgfouine), which took more t...

How to replace {tag_INDEX} with array[INDEX] element

Hi, I have string like this; "String {tag_0} text {tag_2} and {tag_1}" Now i need to replace all {tag_INDEX} with elements from array $myArray = array('a','b','c'); so after replacement it should looks like: "String a text c and b" What is the best way to do this? I'm trying with preg_replace and preg_replace_call...

Can i bind an the datasource Index in a repeater/grid

Hi All, I have a repeater.. and in my repeater i have a link that fires some JS. I would like to pass the itemIndex of the datasource in the JS. Is there some way to do this without using OnItemBound or OnItemCreated?? like.. <a href="#" onclick="dosomestuff(<%# this.item.index %>); return false;">Add Stuff</a> i know the syntax i...

Determine if an Index has been used as a hint

In SQL Server, there is the option to use query hints. eg SELECT c.ContactID FROM Person.Contact c WITH (INDEX(AK_Contact_rowguid)) I am in the process of getting rid of unused indexes and was wondering how I could go about determining if an index was used as a query hint. Does anyone have suggestions on how I could do this? Cheers...

Which index is used in select and why?

I have the table with zip codes with following columns: id - PRIMARY KEY code - NONCLUSTERED INDEX city When I execute query SELECT TOP 10 * FROM ZIPCodes I get the results sorted by id column. But when I change the query to: SELECT TOP 10 id FROM ZIPCodes I get the results sorted by code column. Again, when I change the query t...

[C#] Get Index of Control in an Control-Array

I have a TextBox Array private TextBox[,] Fields = new TextBox[9, 9]; and all the TextBoxes have got the same TextChanged-Event void Field_Changed( object sender, EventArgs e ) Is there a way to get the Index of the sender in the Array (without giving each TextBox it's own EventHandler)? ...

Clustered index - multi-part vs single-part index and effects of inserts/deletes

This question is about what happens with the reorganizing of data in a clustered index when an insert is done. I assume that it should be more expensive to do inserts on a table which has a clustered index than one that does not because reorganizing the data in a clustered index involves changing the physical layout of the data on the di...

How do I create an index on a table that is non unique?

I want an index on a non-primary key column, but this column may have nulls in it. I find on a normal unique index, it (rightly so) only allows one null. Is that possible? and what is the syntax for this? ...

Visual Studio Code Metrics and the Maintainability index of switch case

Hi there! As a person who loves to follow the best practices, If i run code metrics (right click on project name in solution explorer and select "Calculate Code Metrics" - Visual Studio 2010) on: public static string GetFormFactor(int number) { string formFactor = string.Empty; switch (number) { ...