What is nameIndex?

In the docs we have this example:
export const countries = pgTable('countries', {
id: serial('id').primaryKey(),
name: varchar('name', { length: 256 }),
}, (countries) => {
return {
nameIndex: uniqueIndex('name_idx').on(countries.name),
}
});
export const countries = pgTable('countries', {
id: serial('id').primaryKey(),
name: varchar('name', { length: 256 }),
}, (countries) => {
return {
nameIndex: uniqueIndex('name_idx').on(countries.name),
}
});
What does nameIndex mean here? Is it a random text or it actually means something? Also, let's say we have another column called chineseName for example. If an app can search using a where statement with the name columns and, on another query, use a where clause with the chineseName, how should we treat indices? Thank you
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server