mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-04 21:17:37 +03:00
Add a new index for album, to optimize the getAlbumList?type=alphabeticalByArtist
Subsonic query
This commit is contained in:
parent
9712a5b1c6
commit
9e48d87f84
1 changed files with 23 additions and 0 deletions
|
@ -0,0 +1,23 @@
|
||||||
|
package migrations
|
||||||
|
|
||||||
|
import (
|
||||||
|
"database/sql"
|
||||||
|
|
||||||
|
"github.com/pressly/goose"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
goose.AddMigration(upAddAlphabeticalByArtistIndex, downAddAlphabeticalByArtistIndex)
|
||||||
|
}
|
||||||
|
|
||||||
|
func upAddAlphabeticalByArtistIndex(tx *sql.Tx) error {
|
||||||
|
_, err := tx.Exec(`
|
||||||
|
create index album_alphabetical_by_artist
|
||||||
|
ON album(compilation, order_album_artist_name, order_album_name)
|
||||||
|
`)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func downAddAlphabeticalByArtistIndex(tx *sql.Tx) error {
|
||||||
|
return nil
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue