indexing

ArangoDB Index usage with edge collections

别等时光非礼了梦想. 提交于 2019-12-23 12:25:02
问题 Task: Fastest way to update many edges attributes. For performance reasons, I am ignore graph methods and work with collection directly for filtering. ArangoDB 2.8b3 Query [Offer - edge collection]: FOR O In Offer FILTER O._from == @from and O._to == @to and O.expired > DATE_TIMESTAMP(@newoffertime) UPDATE O WITH { expired: @newoffertime } IN Offer RETURN { _key: OLD._key, prices_hash: OLD.prices_hash } I have system index on _to, _from and range index on expired Query explain show 7 edge

Selecting groups fromed by groupby function

て烟熏妆下的殇ゞ 提交于 2019-12-23 12:18:40
问题 My dataframe: df1 group ordercode quantity 0 A 1 B 3 1 C 1 E 2 D 1 I have formed each group by groupby function. I need to extract the data by using group number. My desired ouput. In:get group 0 out: ordercode quantity A 1 B 3 or group ordercode quantity 0 A 1 B 3 any suggestion would be appreciated. 回答1: Use DataFrame.xs, also is possible use parameter drop_level=False : #if need remove original level df1 = df.xs(0) print (df1) quantity ordercode A 1 B 3 #if avoid remove original level df1

How to “explicitly specify the categories order by passing in a categories argument” when using tuples as index keys in pandas?

那年仲夏 提交于 2019-12-23 12:16:40
问题 I've been trying to figure out how to make these tuples index keys in pandas but I'm getting an error. How can I use the suggestion from the error with pd.Categorical below to fix this error? I am aware that I can convert to a string but I am curious to see what is meant by the suggestion in the error message? This works perfectly fine when I run it with 0.22.0 . I've opened a GitHub issue for this if anyone wants to see the proper output from 0.22.0 . I want to update my pandas and handle

Indexing in nested loops

大兔子大兔子 提交于 2019-12-23 11:58:34
问题 I am new to R and this site. My aim with the following, assuredly unnecessarily-arcane code is to create an R function that produces a special type of box plot in ggplot2. I first need to process potential input thereinto by calculating the variables that I shall later wish to have plotted. I start by generating some random data, called datos : c1=rnorm(98,47,23) c2=rnorm(98,56,13) c3=rnorm(98,52,7) fila1=as.matrix(t(c(-2,15,30))) colnames(fila1)=c("c1","c2","c3") fila2=as.matrix(t(c(-20,5,20

Getting null value from intent in deep link

依然范特西╮ 提交于 2019-12-23 11:56:20
问题 I have added a deep link to my app which maps an activity to a particular web page on my website (Link referred: https://developer.android.com/training/app-links/deep-linking ). While handling the deep link in my Java code, getAction() and getData() methods give me null value. I tried testing it here: https://firebase.google.com/docs/app-indexing/android/test (This gave me perfect result) But the same link opens in A web browser rather than in my app when clicked. Android Manifest code :

Do I have to rebuild MongoDB index when I add documents

喜你入骨 提交于 2019-12-23 10:27:10
问题 I have just discovered the extraordinary power of mongodb indexes. Building indexes on just a few fields has allowed me to speed up some operations 1000 fold, and more. My apologies for what might seem a stupid question: once I have built an index on particular fields in my database, will that rebuild itself automatically every time I add and remove documents? Or do I have to call it explicitly? (in a development phase, I might remove EVERY document, and then add them all again) 回答1: MongoDB

When ordering by date desc, “Using temporary” slows down query

依然范特西╮ 提交于 2019-12-23 10:26:33
问题 I have a table for log entries, and a description table for the about 100 possible log codes: CREATE TABLE `log_entries` ( `logentry_id` int(11) NOT NULL AUTO_INCREMENT, `date` datetime NOT NULL, `partner_id` smallint(4) NOT NULL, `log_code` smallint(4) NOT NULL, PRIMARY KEY (`logentry_id`), KEY `IX_code` (`log_code`), KEY `IX_partner_code` (`partner_id`,`log_code`) ) ENGINE=MyISAM ; CREATE TABLE IF NOT EXISTS `log_codes` ( `log_code` smallint(4) NOT NULL DEFAULT '0', `log_desc` varchar(255)

Neo4j indexing (with Lucene) - good way to organize node “types”?

此生再无相见时 提交于 2019-12-23 10:08:08
问题 This is more actually more of a Lucene question, but it's in the context of a neo4j database. I have a database that's divided into 50 or so node types (so "collections" or "tables" in other types of dbs). Each has a subset of properties that need to be indexed, some share the same name, some don't. When searching, I always want to find nodes of a specific type, never across all nodes. I can see three ways of organizing this: One index per type, properties map naturally to index fields: index

Why is PostgreSQL (9.1) not using index for simple equality select?

喜夏-厌秋 提交于 2019-12-23 09:56:46
问题 My table lead has an index: \d lead ... Indexes: "lead_pkey" PRIMARY KEY, btree (id) "lead_account__c" btree (account__c) ... "lead_email" btree (email) "lead_id_prefix" btree (id text_pattern_ops) Why doesn't PG (9.1) use the index for this straightforward equality selection? Emails are almost all unique.... db=> explain select * from lead where email = 'blah'; QUERY PLAN ------------------------------------------------------------ Seq Scan on lead (cost=0.00..319599.38 rows=1 width=5108)

How and when are indexes used in INSERT and UPDATE operations?

二次信任 提交于 2019-12-23 09:33:36
问题 Consider this Oracle docs about indexes, this about speed of insert and this question on StackOverflow lead me to conclusion that: Indexes helps us locate information faster Primary and Unique Keys are indexed automatically Inserting with indexes can cause worse performance However every time indexes are discussed there are only SELECT operations shown as examples. My question is : are indexes used in INSERT and UPDATE operations? When and how? My suggestions are: UPDATE can use index in