Tagged Questions
Indexing data structures is general technique to improve the speed of data lookups.
1
vote
2answers
18 views
index table by name in R
I'm having trouble with the dataset .
the data looks like this:
>data
name L1
1 TSS200 1
2 TSS200 1
3 TSS200 1
4 TSS200 1
5 TSS200 2
6 TSS200 3
7 TSS1500 4
8 TSS1500 4
...
0
votes
5answers
41 views
Java - How to get the index of a given element in an array
I have an array of contacts like so :
public class Application {
private Scanner input;
private Contact[] contacts;
private int ArrayNum;
public Application() {
input = new Scanner(System.in);
...
0
votes
0answers
14 views
MYSQL - join + order by… slow results
I have two tables
search_keywords
keyword_id int
search_volume int
row count: > 2 million
sm_url_keyword
keyword_id int
domain_id int
some_other_data...
row count: > 12 million
On one ...
0
votes
3answers
16 views
numpy array print index of certain value
Given a numpy array
A = np.array([[[29, 64, 83],
[17, 92, 38],
[67, 34, 20]],
[[73, 28, 45],
[19, 84, 61],
[22, 63, 49]],
...
0
votes
0answers
10 views
indexing and searching of non-text data
Is there any efficient way to search for non-text data? For example, let say there are millions of documents of this form:
{
data: [
{attr1: 5, attr2: 4},
{attr1: 3, attr2: 3},
{attr1: ...
0
votes
0answers
4 views
Offset function in Excel for position mismatches
I have a workbook that contains two spreadsheets where I organize my data according to dates. In one of them I run a data query and in the other one I organize the query's data otherwise. In my data ...
5
votes
5answers
57 views
How to convert Swift Character to String?
I want to return the first letter of a String as a String instead of as a Character:
func firstLetter() -> String {
return self.title[0]
}
However, with the above I get Character is not ...
0
votes
1answer
11 views
Oracle index creation strategies
Can any body help to to solve following performance issue.
select 1
from table_1 a
,table_2 b
,table_3 c
where c.trx_date between sysdate-12 and sysdate-12
and c.trx_id=b.trx_id
and ...
1
vote
1answer
27 views
Query Optimization for MS Sql Server 2012
I have a table containing ~5,000,000 rows of scada data, described by the following:
create table data (o int, m money).
Where:
- o is PK with clustered index on it. o's fill factor is close to ...
0
votes
0answers
6 views
Postgresql: Find values in JSON array by wildcard and comparison operators with index
I have a table with JSON array data I'd like to search.
CREATE TABLE data (id SERIAL, json JSON);
INSERT INTO data (id, json)
VALUES (1, '[{"name": "Value A", "value": 10}]');
INSERT INTO data ...
0
votes
0answers
8 views
list index out of range (file) - copy file when any error
I have a problem.
I open a file:
plik_otwarcie = open('/www/pages/DANE/plik.txt').read()
lista= plik_otwarcie.split(',')
My file contain: 1,0,0,1,0 and I need a float(lista[4]), but ...
0
votes
1answer
31 views
Is there a way to display some DIV in all sub-pages?
Is there some css/js/jquery to use on DIV in main index.html if I want to display it in all subpages without editing their code? E.g. <div id="chatbox"> placed in main index.html to show in ...
-1
votes
0answers
12 views
how to use index to query with relaionshups in neo4j
I have an index of relationShip(FansRelationship) in neo4j;and want to use cypther to query
;but I do not know how to use it?
1
vote
0answers
12 views
Is it possible to make elasticsearch index a SVN repo? And specific branches?
Is it possible to make Elasticsearch index a SVN repo directly? and all Docs, and PDFs within it?
1
vote
1answer
19 views
SQL Server Indexing a View that decrypts a column
I'm currently trying to index my view so it doesn't take as long to query against. To simplify things, I'll give an example of my setup.
I currently have a Person table. In the person table, I store ...
0
votes
1answer
27 views
Set Indexes correctly for JOIN + LIKE xyz% query
EDIT3: Here's the real problem:
It now uses the compound index for Contact, but EXPLAIN only lists the fkey index for Address and neither my multi-column index nor any other single-column index.
...
0
votes
1answer
22 views
Using Index Cause MySQL Query Stuck For Infinite Time
I have few mysql tables with huge data. To speed up some frequent queries, I am creating indexes to make queries faster. I already did created few composite index which are working fine.
However, I ...
0
votes
2answers
14 views
How can MySQL use index for function in where?
How can mysql use ts index in this query? (EXTRA: Using where; Using index)
EXPLAIN SELECT * FROM times
WHERE UNIX_TIMESTAMP(CONVERT_TZ(FROM_UNIXTIME(ts), 'GMT', 'EET')) > 10000;
| ID | ...
0
votes
1answer
19 views
How to make an existing AutoIncrement index become the Clustered Index in MySQL?
This is a bit puzzling.
I have a unique non-clustered index I want to turn into the clustered index for that table.
I can't drop and recreate the index, because dropping the index on the AI column ...
0
votes
0answers
10 views
Exact differences between INDEX, FULLTEXT, SPARTIAL, UNIQUE, DISTINCT VALUES in MySQL?
I'm currently creating a big database system and it is very important for me to make it work as perfect as possible after inserting large amounts of data.
When creating a new table there I see are ...
1
vote
0answers
25 views
MongoDB and missing index
after migrating replica set to standalone I have some weird issues with the resulting MongoDB setup. For example, an index on a collection is missing. But trying to reIndex() the collection fails as ...
0
votes
1answer
24 views
Get Date of last record in Date indexed pandas dataframe
I am reading an End of Day price csv file and use the date column to index the dataframe. I want to check the date of the last record. I get the index value location, but have not figured out how to ...
1
vote
1answer
16 views
Get index of array at equal points
Let's say you have an array of length 20. You want to access 3 equally spaced indices: 0, 9, 19.
How can you do this with any length of array and any number of sections?
I feel like there must be an ...
0
votes
1answer
29 views
Boolean expressions and control flow involving manipulating index numbers
Tried this in Python as part of a function, and predictably, it did not work:
outputlist = [-5,-4,-3,-2,-1,0,1,2,3,-2,-1,0,2,4,-3,-2,1,0,2]
def counter(outputlist):
outputlistcut = ...
0
votes
0answers
16 views
Using unaccent in tsvector trigger
I would like to use postgresql's unaccent contrib package in my tsvector column. I have successfully installed the package using create extension unaccent, and have checked that it works. I had set up ...
-2
votes
0answers
17 views
Error message in matlab, "Indexing input must be numeric, logical or ':'.'
I tried to solve a system of non liniear equations and generate a steady state curve. I kept getting the message: "
Error using sym/subsindex (line 1555)
Indexing input must be numeric, logical or ...
0
votes
1answer
13 views
Is there an equivalent to Elasticsearch index aliases in Solr + Sunspot?
With ElasticSearch, an app can point to the alias of an index, instead of the index directly, which makes it easy to switch the index the app uses.
Tire, the equivalent of Sunspot for ES, allows me ...
0
votes
1answer
35 views
Create an index tree (balanced BST) from a linked list
I have a Doubly Linked List which I want to create an index tree from to increase random access performance. The nodes in the linked list don't have a unique identity and can be any instance of a ...
0
votes
1answer
16 views
PHP PDO Return Column Value From Row By Index
I have written this code:
$statement = $db->prepare("SELECT answer FROM question WHERE question = :question");
$statement->execute(array(':question' => $question));
$row = ...
0
votes
1answer
36 views
Why am I getting an indexing error even though I'm not trying to index anywhere?
I execute a single command and I get:
>> rms = rms(distances(1:50,1))
Subscript indices must either be real positive integers or logicals.
distances is just a vector of non-negative doubles.
0
votes
2answers
30 views
Error when trying to get index of an Array
I have a program where the user inputs a string. This strings length is always a multiple of 8.
So to convert the string I split the string every 8 characters into an array.
I do that with this code
...
-1
votes
1answer
9 views
Make index available on the run not after completion
I am creating lucene index and on the top of that creating cleo index.
The problem is that the data on which this index is going to be created is very large, it may be 1 billion.
I want to make the ...
0
votes
2answers
13 views
Multiple column index and single column index
In mysql indexing
Case 1 :
Created the index for two column, but used only one column in where clause.
Will it use index?
Case 2:
Created the index for single column, but used index ...
0
votes
2answers
23 views
Two indexes with same name in Oracle schema
I'm wondering why can't I have two indexes with same name in Oracle schema? It throws an error saying that the name is already been used.
I was under an impression, since the index is on a particular ...
2
votes
1answer
63 views
Indexing and slicing structured ndarrays
Now I'm trying to understand possible ways to index numpy structured arrays, and I kinda get stuck with it. Just a couple of simple examples:
import numpy as np
arr = np.array(zip(range(5), range(5, ...
-2
votes
3answers
40 views
How to create binary variable from variables having characters and numbers?
My data is as below
ID var1 var2
1 A 2
2 5 6
3 B 3
4 7 D
5 1 1
6 2 5
7 6 Y
8 7 G
9 8 C
Value of Var1 and Var 2 are one of 1~9,A~Z. I want ...
0
votes
1answer
16 views
Rank duplicate text values
Looked around, but could not quite get this to work. I think it's really easy, but match and index functions are tripping me up.
Here's the example. I have three columns of data:
Name Date ...
0
votes
2answers
19 views
Why does my ForEach loop only grabs last item in array?
I want to perform a function for every item in my array, but it only triggers for the last item in the array and I'm not sure how to go about fixing this:
$scope.PlayMovie =function(){
...
-2
votes
0answers
69 views
SQL performance gain because of a index, but why? [on hold]
I have the following query and Explain Plan.
SELECT PM.CUPS,
HE.DAY,
HE.HOUR,
HE.VALUE_1,
(CASE
WHEN (HE.QUALITY_1 < 0 AND HE.QUALITY_1 ...
0
votes
0answers
27 views
Elasticsearch filtering/querying on different indexes?
Is it possible to search through an index for all the records that include a value that is not a part of another index?
For example, if I have an index called user_accounts that has the following ...
0
votes
1answer
24 views
B+ tree or B-tree
I am learning about postgresql internals and I am wondering or postgresql B-tree index is actually classic B-tree or B+tree? To spell it out, that means the nodes contain only keys or key-value pairs?
...
0
votes
2answers
38 views
Find array index if given value
I want to retrieve the index in the array where the value is stored. I know the value of the item at that point in the array. I'm thinking it's similar to the findIndex function in c#.
For example, ...
2
votes
1answer
57 views
Why do I have to rebuild the indexes on a table after inserting >150,000 records?
I have a daily process which imports about 150,000 records into two tables, and later joins them to compare against other data.
I have created indexes on the tables which makes the comparison process ...
2
votes
1answer
40 views
Python repeatedly randomly deleting list entries
I am trying to randomly delete a list from a list of lists in Python. It keeps giving me the error:
IndexError: list assignment index out of range
I don't understand how I am referencing somewhere ...
0
votes
1answer
16 views
Custom made constraint in PostgreSQL
I have a table with the following fields and sample records:
sample_date customer active
25/12/2010 12356 N
01/12/2012 12356 N
05/11/2013 12356 N
05/07/2014 12356 ...
0
votes
1answer
14 views
Best Implementation of “Sql Table index” on a .net list
In SQL you can apply an index on a table, by that the table is sorted behind the scenes by these columns, which makes inserting and updating more slow, yet selecting by that column is much faster,
Is ...
0
votes
1answer
36 views
T-SQL - Alter index, add INCLUDE columns
I have a table
CREATE TABLE Test
(
id int primary key,
a nvarchar(max),
c nvarchar(max),
b nvarchar(max)
)
I want to improve performance of queries to the table and want to create ...
-1
votes
1answer
44 views
python: How create a list by other list items index?
I have two lists and four dics.
names = ['ana', 'jeny', 'jon', 'mary', 'james', 'robert']
dic1 = {}
dic2 = {}
dic3= {}
dic4 = {}
And i have a list with four dics.
diclist = [dic1, dic2, dic3, ...
0
votes
1answer
23 views
MongoDB indexing results on array fields
I have a collection as { student_id :1, teachers : [ "....",...]}
steps done in sequence as : 1) find by {teachers : "gore"}
2) set the index as { student_id : 1 }
3) find by {teachers : "gore"}
...
2
votes
3answers
33 views
Avoiding off-by-one errors when removing columns based on indices in a python list
I have a target file called TARGFILE of the form:
10001000020002002001100100200000111
10201001020000120210101100110010011
02010010200000011100012021001012021
00102000012001202100101202100111010
My ...