I have a collection with approximately 500 million documents where it seems the uniqueness constraint has not been enforced on a specific subset of these. The uniqueness contraint applies to a compound index.
The indices on this…
I'm having trouble with a unique compound index in mongodb. Code speaks best so (in mongo shell):
var collection = db.getCollection('test');
collection.drop(); // start from scratch
collection.createIndex({date:1});
collection.createIndex({_id:1,…
I'm analyzing texts. Those texts have annotations (e.g. "chapter", "scenery", ...). Those annotations are in my MongoDB collection annotations, e.g.
{
start: 1,
stop: 10000,
type: chapter,
details: {
number: 1,
title: "Where it all…
if i have tabled:
Resource (id (PK), name)
Manager (id(PK), resource_id (FK), manager_resource_ID(FK))
Should resource_id and manager_id both be foreign keys into the Resource table.
i obviously dont want to enter any values in each of those…
I have the following MySQL/InnoDB table. I added a compound index as the primary key on both columns, and I have also added two single column indexes. With the compound index in place am I getting any performance increase from the single column…
I have two lookup/reference tables (Subscribed and Unsubscribed) in my Microsoft SQL Server 2008 database with the following structure:
UserId int
PublicationId int
These fields are indexed together as a compound index.
What I want to be able to do…
So if I have a query that does the following (in pseudo code)
find(a nearby x, b > y).sort(c)
where a is a geo column, b is type of long, and c is also a type of long
Would the compound index on (a:2d, b:1, c:1) work and suggested?
According to the answer given here, Elasticsearch doesn't seem to use compound indexes for querying multiple fields, and instead queries multiple indexes and then intersects the results.
My question is how does it achieve such high performance?…
I have a Student Schema defined using mongoose. To create a primary key with both name and subject field, i have created a compound index with name and subject field.
@Schema()
export class Student {
@Prop({ type: String, required: true, unique:…
We have a collection with millions of data. This data is being rendered in the UI for stats purpose and hence time to render is of key importance.
The queries to render the data involve the below fields:
field_a and field_t
field_b and…
I know that this MariaDB version 5.5.68 is really out of date, but I have to stay with this old version for a while.
Is there a way to prevent toxic selects, possibly blocking MyISAM tables for a longer time (minutes)? The thing is that the select…
When I used numbers as keys, the compound index prefixes created were not as expected。
To define a compound index:
admin> use TestDB
TestDB> db.createCollection('coll')
TestDB> db.coll.createIndex({4:1,1:-1},{unique:true})
TestDB>…