You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can you tell me which version of the library you are using and the size of your collection?
If the collection is big, you should probably use indexes, which are available in the v2 version
Anyway, using string dates is not a good idea for comparison
I'm using v2 version and collection about 140Mb. I try to use time.Time type, but get the same result. I see only support one index, then ad_id is the index.
The size of docs when ad_id="1749344214764583" is about 10. Range query of this 10 docs expects to be very fast.
query like
query :=clover.NewQuery("stat"). Where(clover.Field("stat_time").GtEq("2022-11-14"). And(clover.Field("stat_time").LtEq("2022-11-15")). And(clover.Field("ad_id").Eq("1749344214764583"))). Sort(clover.SortOption{Field: "stat_time", Direction: 1})
very fast.
but
query :=clover.NewQuery("stat"). Where(clover.Field("ad_id").Eq("1749344214764583")). And(clover.Field("stat_time").LtEq("2022-11-15")). And(clover.Field("stat_time").GtEq("2022-11-14")). Sort(clover.SortOption{Field: "stat_time", Direction: 1})
very slow.
Why?
The text was updated successfully, but these errors were encountered: