Is unique index always used if query is on first constituent column ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

suppose we have  2 columns a and b  . we need to query by a and sometimes
by b  for data consistency UNIQUE(a,b) also needs to be there. we create
indexes below:

create unique index ab on t(a,b);
create index b on t(b);

it has been observed that index ab is used while querying
for a , can we always avoid creating the extra index on a ie,
create index a on t(a); (does other databases also behave
similar?)

Regds
mallah.


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux