indexing

Indexing columns in a csv file

∥☆過路亽.° 提交于 2020-01-15 03:14:11
问题 I have a large csv file which each row has different columns, such as ID, username, email, job position, etc. I want to search for a row by exact matches (username == David), or wildcard (jobPosition == %admin). I want to index columns in this file to make searches faster, but I don't know which algorithm should I choose (specially for wildcards). 回答1: You can index the file. But you need to read it as a binary file instead of a text file. Use 128 or 256 block size. To build the index, you

Mongo $in with order indexing

久未见 提交于 2020-01-15 01:50:16
问题 I have a collection following this "schema" : { _id: ObjectId, order: Number, fieldA: ObjectId, fieldB: Array[ObjectId] } And an index defined like this : { fieldA: 1, fieldB: 1, order: 1 } When running a find query like this one : { $and: [ {fieldA: {$in: [{"$oid":"592edae196232608d00f78f5"},{"$oid":"592edadc96232608d00f5614"}]}}, {fieldB: {$in:[{"$oid":"592edace96232608d00ef77f"},{"$oid":"592edacd96232608d00ef34b"}]}} ] } with sort defined as { order: 1 } The query runs fine, the index

How to create a column/index based on either of two conditions being met (to enable clustering of matched pairs within same dataframe)?

眉间皱痕 提交于 2020-01-14 18:52:32
问题 I have a large dataset of matched pairs (id1 and id2) and would like to create an index variable to enable me to merge these pairs into rows. As such, the first row would be index 1 and from then on the index will increase by 1, unless either id1 or id2 match any of the values in previous rows. Where this is the case, the previously attributed index should be applied. I have looked for weeks and most solutions seem to fall short of what I need. Here's some data to replicate what I have: id1 <

How to compare performance on neo4j queries without cache?

自古美人都是妖i 提交于 2020-01-14 13:37:30
问题 I've been trying to compare queries performance in neo4j. In order to make the queries more efficient, I added index, analysed the result using profile, and tried doing the same while using the USING INDEX. On most queries, DB Hits were much better using the second option (with the USING INDEX), rows were the same or less, but the time performance seems not to be reliable: on several queries adding the USING INDEX was slower though the better performance parameters (db hits & rows)and times

Mapping for array of geo_point fields in elastic

大憨熊 提交于 2020-01-14 10:42:36
问题 I'd like to persist some JSON to elastic(search) that looks a little like this: { "name": "value", "points": [ { "lat": 0.0, "lon": 0.0 }, { "lat": 1.0, "lon": 1.0 } ] } Points being a list of the type geo_point in elastic. Because they're geo_point values I need to define the index mapping, but the closest I can see is to do this: "place": { "properties": { "name": { "type": "string" }, "points": { "properties": { "location": { "type": "geo_point" } } } } } Which would mean having each point

Mapping for array of geo_point fields in elastic

大兔子大兔子 提交于 2020-01-14 10:42:28
问题 I'd like to persist some JSON to elastic(search) that looks a little like this: { "name": "value", "points": [ { "lat": 0.0, "lon": 0.0 }, { "lat": 1.0, "lon": 1.0 } ] } Points being a list of the type geo_point in elastic. Because they're geo_point values I need to define the index mapping, but the closest I can see is to do this: "place": { "properties": { "name": { "type": "string" }, "points": { "properties": { "location": { "type": "geo_point" } } } } } Which would mean having each point

MySQL error when editing product in Magento

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-14 10:37:08
问题 it's a v 1.4.1.1 Magento, upgraded from a v 1.3.2.4 When I try to edit a product an error message appears: exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '6028-0-2' for key 'PRIMARY'' And if I try to reindex prices I have the same message in exception.log I think the problem is in the catalog_product_website table, because if I delete the row, I can run the price indexing, but as I try to edit the product to assign

Index Word/PDF Documents From File System To SQL Server

萝らか妹 提交于 2020-01-14 10:12:20
问题 I'm trying to come up with a simple solution to a problem I have because all of those I have found so far just seem too complicated! The situation is that we use a proprietary application for managing most aspects of our business. It has an SQL Server 2005 backend database, which is quite large. The application also allows the attaching of Word and PDF documents to records, which we use extensively, and these are stored in the file system on the server, with the filenames referenced in the

What are the differences between 'shrink space compact' and 'coalesce'?

眉间皱痕 提交于 2020-01-14 09:43:10
问题 The oracle documentation says that during altering an index clauses shrink space compact and coalesce are quite similar and could be replaced by each other, but Tom found some differences in the behavior. Since coalesce is not available in standart edition of Oracle Database, I suppose there're some benefits in using it. So, what are the differences? Can I perform shrink space compact on a dynamically changing index? 回答1: The above answer is false. There are basically 4 options. 1 - ALTER

Index already exists with different options error while using createIndex() in latest MongoDB java driver

左心房为你撑大大i 提交于 2020-01-14 07:55:12
问题 So I am upgrading the MongoDB java driver to 2.12.4 where the ensureIndex() method has been deprecated. I am instead using the createIndex() method which from the docs seems like to funciton similarly to ensureIndex() . However, when I use this method in production, I get the following error - { "serverUsed" : "X.X.X.X" , "ok" : 0.0 , "errmsg" : "Index with name: <index_name> already exists with different options" , "code" : 85} Why does this happen? Could anyone help me out with this? Thanks