index

PHP get index of last inserted item in array

It's as easy as the title sounds; I need to get the index/key of the last inserted item. Why is this difficult? See the following two code samples: $a=array(); echo 'res='.($a[]='aaa').' - '.(count($a)-1).'<br>'; echo 'res='.($a[]='bbb').' - '.(count($a)-1).'<br>'; echo 'res='.($a[]='aaa').' - '.(count($a)-1).'<br>'; die('<pre>'.print_r...

Javascript + How to get the index w.r.t the parent Node of selection + Browsers Other than IE

Hi I want to get the selection start and end index with respect to the parent node of the selected text. I am able to do this in IE. However in other browsers like Firefox, Opera, Safari and Chrome, I am able to access the selection and the index of the selected text. But my requirement is to get the index w.r.t the parent node and not t...

How to create programmatically an index in a SQLite database with Xcode ?

I use in my iPhone application a very big database. An index is used on one of its columns in oder to make the searchs in this database faster. The problem is that this index increases the size of the database : my application is now bigger than 20 Mo requiring a wifi download (I would like to remain below 20 Mo in order to allow 3G down...

T-SQL for finding Redundant Indexes

Is anyone aware of a T-SQL script that can detect redundant indexes across an entire database? An example of a redundant index in a table would be as follows: Index 1: 'ColumnA', 'ColumnB', 'ColumnC' Index 2: 'ColumnA', 'ColumnB' Ignoring other considerations, such as the width of columns and covering indexes, Index 2 would be redunda...

Should I create an index on the columns if their values are used in functions ? (SQLite)

Hi ! I am working with a huge database and trying top optimize it. I was wondering if it will make any change to index the values that are used as criteria in the request, but through a function. For example I have this GPS coordinate table : -Node (#id,lat,lng) and this request : SELECT * FROM Node WHERE distance( lat, lng, $lat, ...

Basic optimisation with an index for mysql

Hi, i have a question about basic mysql database optimisation. I have 3 tables, Articles, Tags and Taggings (which is a join table). Articles Taggings Tags id id id name article_id name tag_id I am retrieving the articles that exactly match the ...

Schema generation for maps in Hibernate

Hi there, I have a class Folder and a class File with a one-to-many relationship between them, implemented with a Map. Here is the hibernate mapping file: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3...

how to call pm files from index file in perl?

I want to use files that are inside cgi-bin folder in perl, I want to call them from index.cgi When I do this: use cgi-bin/file_name it doesn't work, how can I do that? ...

primary key and index concept

hi, I create a column as primary key , does this create indexes automatically ? or do i need to create indexes explicitly. i was under assumption that primary key also maintains indexes ...

mysql index size and duplicacy questions

Hello, I have a few general questions about database Index. Answers to any question are awaited: How to calculate total memory size occupied by an index. And is the size of index directly proportional to its Cardinality ? Do we need to index primary key, or is it indexed by its own. And how will it effect the memory and processing spe...

Default Index on Primary Key

Does the SQL Server build an index on primary keys by default? If yes what kind of index? If no what kind of index is appropriate for selections by primary key? I use SQL Server 2008 R2 Thank you. ...

TSQL Script Index Creation that can be rerun

I want to have a script of indexes that I can append to and rerun as new tables are added to my schema. For this reason, I want to skip creating indexes that already exist, but I have been unable to find a clean way to detect the index is already there. What I want to do is something like this: IF OBJECT_ID(N'[dbo].[Users].[IDX_LastName...

SQL Server Indexes

I was a MySQL user. Now I'm migrating to SQL Server. But I have a problem. I can not find any way for specifiying the kind of index a table has. In MySQL I could easily say to build a BTree Index or Hash Index. How can I do that here? The main problem is that I have two tables. one of them (named "posts") has a foreign key to the other ...

What is an index in SQLite?

I don't understand what an index is or does in SQLite. (NOT SQL) I think it allows for sorting in acending and decending order and access to data quicker. But I'm just guessing here. ...

Should I denormalize properties to reduce the number of indexes required by App Engine?

One of my queries can take a lot of different filters and sort orders depending on user input. This generates a huge index.yaml file of 50+ indexes. I'm thinking of denormalizing many of my boolean and multi-choice (string) properties into a single string list property. This way, I will reduce the number of query combinations because mo...

Google App Engine index costs

From what I've understood, App Engine indexes are costly both in terms of increased overall storage size and by slowing down your writes. But do indexes only cost when they're actually used in queries and are explicitly defined in index.yaml? Or do properties such as StringProperty cost more than their non-indexed counterpart (e.g. Text...

ListView inserted item's index

I have a ListView and sorting is enabled, once I insert an item, how do I get that item's index? I can use the ListViewItem returned by the Add method of ListView, but is its index before sort or after? And is it updated if it is sorted again? Like if I store the ListViewItem and the ListView is then sorted, will the ListViewItem I stor...

Using jQuery, is this the most efficient way to combine similar functions into .each()?

I'm using jQuery and the Datatables plugin. When a row is clicked, a hidden row appears with details about that record that can be edited. After those details are edited and the hidden row is closed, the cells of the main table that have changed are updated. Here's my old code: function teacherTableUpdate(nTr) { oTable.fnClose(nTr)...

Word importance in lucene index

Hi all! hmmm, i need to get how important is the word in entire document collection that is indexed in the lucene index. I need to extract some "representable words", lets say concepts that are common and can be representable to whole collection. Or collection "keywords". I did the fulltext indexing and the only field i am using are te...

PHP word index, performance and reasonable results

Hello, I'm currently working on an indexer for a search feature. The indexer will work over data from "fields". Fields looks like: Field_id Field_type Field_name Field_Data - 101 text Name Intel i7 - 102 integer Cores 4 physical, 4 virtual - 103 select Vendor Intel - ...