Open daw3gr opened 1 year ago
Try adding option threads=1
. Does it help?
Hi @sanikolaev, thanks, it does indeed, repeated the queries a number of times and now the results are consistent at all times. What is the cause of this behaviour? Thanks again.
As said in the [docs](https://manual.manticoresearch.com/Functions/Mathematical_functions#RAND()):
If you use the seed take into account that it resets
rand()
's starting point separately for each plain index / RT disk / RAM chunk / pseudo shard, so queries to a distributed index in any form can return multiple identical random values.
I'm not sure about the zeroes though. Is there a simple way to reproduce them with a synthetic case like this?
create table ...
insert into ...
select ...
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Feel free to re-open the issue in case it becomes actual.
Left this potential bug on the manticore forum but unsure if it is unattended as there was no response.
I have a query for an index like this where for showing the behaviour seed is always 1:
select id, weight() as w, rand(1) as r, if ( (now() - fe) < 7776000, 100,0 ) as new, if ( (now() -fe_xtra) < 8640060 , 1000,0 ) as bumped, weight()(1+ new + bumped ) as composite_bumper from spv_101001001 WHERE pwt = 65 order by r desc limit 0, 20;
For the given dataset, If I ran the query a number of times, while r returns always the same values as expected, I get two different sets of results, and always two…
Result 1:
Result2:
The results should be unique, this prevents consistent pagination through results.
I have run the same query with different seeds and what I can see is that the id for the first result is always + or - 10 of the other set of results, for some of the remaining results this is also the case, in this example the last result exhibits the same behaviour.
Version info:
One other thing that makes me suspect that its a big is that if I modify the search a bit, then, occasionally, I get rand() to be 0.0000 for some or all of the results as follows: