index

iPhone UITableView with index can I push a different detailed view with every different cell?

Hello All, I know its possible to create a table that has an index on the side and a search bar at the top that a user can type in to find an item, but is it possible to say to the table if array isEqual to "item1" push view1? I would like to push a different view with each cell. Anyone have any advice? ...

A very interesting MYSQL problem (related to indexing, million records, algorithm.)

This problem is pretty hard to describe and therefore difficult to search the answer. I hope some expert could share you opinions on that. I have a table with around 1 million of records. The table structure is similar to something like this: items{ uid (primary key, bigint, 15) updated (indexed, int, 11) enabled (indexed, tinyin...

How to structure an index for type ahead for extremely large dataset using Lucene or similar?

I have a dataset of 200million+ records and am looking to build a dedicated backend to power a type ahead solution. Lucene is of interest given its popularity and license type, but I'm open to other open source suggestions as well. I am looking for advice, tales from the trenches, or even better direct instruction on what I will need a...

The explain tells that the query is awful (it doesn't use a single key) but I'm using LIMIT 1. Is this a problem?

The explain command with the query: explain SELECT * FROM leituras WHERE categorias_id=75 AND textos_id=190304 AND cookie='3f203349ce5ad3c67770ebc882927646' AND endereco_ip='127.0.0.1' LIMIT 1 The result: id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE ...

Why is Oracle using a skip scan for this query?

Here's the tkprof output for a query that's running extremely slowly (WARNING: it's long :-) ): SELECT mbr_comment_idn, mbr_crt_dt, mbr_data_source, mbr_dol_bl_rmo_ind, mbr_dxcg_ctl_member, mbr_employment_start_dt, mbr_employment_term_dt, mbr_entity_active, mbr_ethnicity_idn, mbr_general_health_status_code, mbr_hand_dominant_code, mbr_h...

SQL Server Index Naming Conventions

Is there some standard way to name indexes for SQL Server? It seems that the primary key index is named PK_ and non-clustered indexes typically start with IX_. Are there any naming conventions beyond that for unique indexes? ...

Script to drop an index if it exists that works in SQL Server 2005 AND SQL Server Compact 3.5

I have an application with a rather long chain of upgrade scripts. The application works in SQL Server 2005 - I'm trying to upgrade it so it will also work in SQL Compact 3.5 Part of the script involves dropping old indexes if they exist. I REALLY want to have one script that can handle both scenarios. I've been having a lot of success...

getting rid of filesort on WordPress MySQL query

An instance of WordPress that I manage goes down about once a day due to this monster MySQL query taking far too long: SELECT SQL_CALC_FOUND_ROWS distinct wp_posts.* FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) LEFT JOIN wp_term_taxonomy ON wp_term_taxonomy.term_taxonomy_id = wp_term...

Why Microsoft has put 2 different options for creating Unique Indexes on a table in SQL Server 2005?

Why Microsoft has put 2 different options for creating Unique Indexes on a table in SQL Server 2008? Manage Indexes/Keys : 1 ) type = Unique Key ==> IsUnique = Yes (IsUnique is disabled) 2 ) type = Index ==> IsUnique = Yes Thank you ...

Will creating index help in this case

I'm still a learning user of SQL-SERVER2005. Here is my table structure CREATE TABLE [dbo].[Trn_PostingGroups]( [ControlGroup] [char](5) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [PracticeCode] [char](5) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [ScanDate] [smalldatetime] NULL, [DepositDate] [smalldatetime] NULL, [NameOfFile]...

Parse error: syntax error, unexpected T_STRING with index.php?

It works perfectly in local host but when I upload it intothe server it has the following error: Parse error: syntax error, unexpected T_STRING in D:\Hosting\4923367\html\beta\index.php on line 4 index.php: <?php include_once 'localization.php'; ?> <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Tr...

Get highest frequency terms from Lucene index

Hello! 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 threshold, i will analyze results) and their per-index counts. I am aware that I might lose some precision because of potentionally dr...

How can I send parameters to a sub-index page?

Hello. I have a homepage, for example: www.example.com. There is a url like this: www.example.com/subdirectory/page.php?var1=A&var2=B It's a long url, so I changed it like this: www.example.com/subdirectory/page/A/B as well as I config the .htaccess file: <Files page> ForceType application/x-httpd-php </Files> Howe...

MySQL: how to index an "OR" clause

I'm executing the following query SELECT COUNT(*) FROM table WHERE field1='value' AND (field2 >= 1000 OR field3 >= 2000) There is one index over field1 and another composited over field2&field3. I see MySQL always selects the field1 index and then makes a join using the other two fields which is quite bad because it needs to join 146...

C# IndexOutOfRange issue, probably simple.

Banging my head off the wall due to this. I'm getting the error at cell[rcell] = repack[counter] even though I have 190 items in the repack array. private string csvtogrid(string input) { input = input.Replace("\r", ",").Substring(2).TrimEnd(',').Trim().Replace("\n", ",").Replace(",,,", ",").Replace(",,",","); ...

collection/string .Contains vs collection/string.IndexOf

Is there a reason to use .Contains on a string/list instead of .IndexOf? Most code that I would write using .Contains would shortly after need the index of the item and therefore would have to do both statements. But why not both in one? if ((index = blah.IndexOf(something) >= 0) // i know that Contains is true and i also have the ...

can i changed for loop index variable inside the loop in Matlab???

hi every one. i need to change my loop variable inside the iterationa as ihave to acces array elements in the loop which is changing w.r.t size inside the loop. ashort piece of code is that: que=[]; que=[2,3,4]; global len; len=size(que,2) x=4; for i=1:len if x<=10 que(x)= 5; len=size(que,2) x=x+1; end end que a...

Android SQL problem on app similar to notepad tutorial:CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0

Hi, im triying to do an app using the notepad tutorial of Android as a guide. I can insert new elements on the table without problems, but if i want to update the fields of one of this elements an error is prompted. I revisited the tutorial lots of times but i cant find the solution. Thank you! Here is the menu (to insert, delete and u...

A question about indexes regarding to the gain of inserts & updates in database

Hi, I’m having a question about the fine line between the gain of an index to a table there is growing steadily in size every month and the gain of queries with an index. The situation is, that I’ve two tables, Table1 and Table2. Each table grows slowly but regularly each month (with about 100 new rows for Table1 and a couple of rows f...

Index question: Select * with WHERE clause. Where and how to create index

Hi, I’m working on optimizing some of my queries and I have a query that states: select * from SC where c_id ="+c_id” The schema of ** SC** looks like this: SC ( c_id int not null, date_start date not null, date_stop date not null, r_t_id int not null, nt int, t_p decimal, PRIMARY KEY (c_id, r_t_id, date_start, date_stop)); My ...