Let's say I have a compound index involving these 3 columns.
(name, email, phone)
Is this index still will be used for these queries? The first query involves just 2 of indexed fields and the second index using more then all of the fields. By the…
I have a really slow query that repeats itself quite a bit. I've tried indexing the individual fields but it doesn't seem to help. The CPU usage is still very high and the queries still appear on the slow query log. It seems I need a compound…
I have created a table in rails with PostgreSQL, it's a join table between account and program, what the best way to add the index? Do I need the single indexing index: true for each reference when I have both order of compound…
I'm using mongoDb in our project and got stuck at a point.
I'm using bulkOperation of mongoDb to save a list of Objects.
I need to make two fields (mac and gatewaytime ) as a compound index on a collection that make up an unique combination for…
I'm looking to upgrade a MongoDB 2.4.x instance to 2.6. As part of this process I ran the db.upgradeCheckAllDBs() method to ensure my data is in a correct state for the upgrade. This check found a number of records in my database for which there…
I have the following query with a subquery and self join:
SELECT bucket.patient_sid AS sid
FROM
(SELECT clinical_data.patient_sid,
clinical_data.lft,
clinical_data.rgt
FROM clinical_data INNER JOIN
(SELECT…
I have millions of documents in various collection.
My application has to periodically update some incremental data to MongoDB. How do I acheive this?
For every record in incremental data, if the record exists it must be updated with new values…
I have a requests table within my database which consists of a few fields such as "pending" to denote if a request has not been serviced, "expiry" to keep a track of the expiry time in milliseconds (Epoch), "count" which counts down to 0 every time…
I have the following query that works fine but is slow, however I can't figure out how to index it properly:
r.db('my_db')
.table('messages')
.filter({ community_id : community.id})
.filter(function(row){
return…
I have a mongodb collection.
{
"p1": "V1",
"p2": ["V2","V3","V4"],
"p3": ["V5","V6","V7"],
"p4": "V8"
}
I want to create an index on fields p1, p2, p3. My documents may not have p2 or p3. How should I create my index?
Is creating multiple compound indexes for serving various types of queries is better?
or
Is it better to
use a single compound index in a way that supports multiple queries(which is hard to analysis and construct, since there are many number of…
When working with data from database, we often get arrays of stuff that, due to database constraints, can be (uniquely) indexed by compound indices. However, indexBy does not seem to work for compound indices, or does it?
Given an array x with…
I have a collection in which the _ids are compound of a time and an string (yeah, I know it's bad but... it was like that when I arrived). One record in that collection looks like:
{
"_id": {
"my_string": "Foo",
"my_time": new…