Way to generate Multicolumn Indexes? #762
Labels
No Label
backport/done
backport/v1
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
frontport/done
frontport/main
invalid
kind
breaking
kind
bug
kind
build
kind
dependencies
kind
docs
kind
driver
kind
enhancement
kind
feature
kind
performance
kind
proposal
kind
question
kind
refactor
kind
testing
need
feedback
need
test
proposal:accepted
RaspBerry Pi
regression
skip-changelog
upstream
wip
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#762
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
https://www.postgresql.org/docs/9.6/static/indexes-multicolumn.html
https://dev.mysql.com/doc/refman/5.7/en/multiple-column-indexes.html
seems there is only create single column index.
@lunny this just create separate index for
Column1
andColumn2
, will generate sql:How to generate this following sql?
or even more condition:
Have you tried this code?
@lunny , Sorry, it created the index, I am not try it before.
But how to create index with specifies descending sort order?
With the same name on the quote after index will be a group indexes. Currently it didn't support custom index sequence.
thanks, please notice
CreatedAt desc
on above sql, the descending sort seems cannot createdIt's not supported.
@lunny Can you add support for custom index sequence?
@lauyoume any suggestion about the xorm tag format to support custom index sequence? How about
@lunny
Not only index sequence, Now using tag can't fully describe the order of the columns in the index.
Your implementation is currently based on the order of the structure fields.
If I want to create two indexs like this, how to describe the order of col1/col2/col3.
beego orm, Using interface to custom index
How about
It's a good solution, may you add support for this?
@lauyoume I will try this.
@lunny any plan for this feature?
No plan currently. Maybe someone could send a PR to fix.