[haiku-development] Re: All sorts of query/index problems on fresh installs of Haiku

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sat, 05 Mar 2011 00:54:48 +0100

Ingo Weinhold <ingo_weinhold@xxxxxx> wrote:
> On 2011-03-04 at 17:09:03 [+0100], Urias McCullough 
> <umccullough@xxxxxxxxx> 
> wrote:
> > However, it seems if you create a query that has nothing in it, and
> > then modify non-indexed attributes so that they meet the query
> > conditions (or in my case, copy files to the volume in queestion),
> > they will show up in the query results that one time. They will 
> > then
> > disappear when you re-run the query.
> > 
> > I assume this is a "feature" - is this the expected behavior?
> I don't think so. Sounds very much like a bug to me.

It's at least a known bug, and IIRC it was already in the original BFS 
as well :-)
It stems from the implementation of live queries: when an attribute 
changes, the file is checked to match the live queries, and that check 
does not care whether or not an index exists for the attribute.

I didn't consider this behaviour worth fixing, as the implementation 
would need to perform some caching in order to know if an index exists.
But even then, it wouldn't be perfect, as it couldn't differentiate 
files that aren't in the index yet because their respective attribute 
had been written before the index had been created. Testing this as 
well would be possible, but much too expensive.

> Depending on whether your query formula also contained an indexed 
> attribute, this is either a general BFS query bug or maybe just one 
> in the 
> new feature that formulas no longer need to contain at least one 
> indexed 
> attribute (which didn't work in BeOS).

This has been disabled in our BFS as well, as it could considerably 
slow down certain applications that query but don't care whether an 
index already exists. Since Deskbar was one of those, it was quite 
noticeable :-)
The feature now needs to be enabled deliberately using the 
B_QUERY_NON_INDEXED query flag.

Bye,
   Axel.


Other related posts: