Reply To: ‘idx’ and ‘disable’ fields in database

#10053
fizze
Participant

ad b.)

Each (proper) database needs an primary key, for firefly’s song-db this is the field called “idx”.
One index uniquely identifies an mp3.

Normally, this is linked to a sequence, so that any inserts should youse NEXTVAL (or similiar) from that sequence to populate the songs.idx field.

Also, and index greatly increases performance on said fields.
A

select * from songs where idx=1232;

doesnt do a full table scan, for instance 😉