CREATE INDEX Siparisler ON Test2(cariHesapKodu
,tarih DESC
) WHERE (fisNo is not null)
Index create success.
Query works with cariHesapKodu index use but tarih column not use.
use index
Explain Select * From Test2 Where fisNo IS NOT NULL AND cariHesapKodu="" ORDER BY tarih DESC LIMIT 20 OFFSET 0
Not use index
Explain Select * From Test2 Where fisNo IS NOT NULL AND cariHesapKodu="" AND tarih >=“2010-01-01T00:00:00” ORDER BY tarih DESC LIMIT 20 OFFSET 0