Subject | Re: Can someone explain to me what's the best way to do this? |
---|---|
Author | andrew_s_vaz |
Post date | 2004-11-30T18:57:35Z |
Hi Svein,
could be used, whereas if you used a parameter rather than a
constant, no index would be used), whereas STARTING [WITH] normally
uses an index if available.
Ok, and if I'm building the queries on-the-fly and using the "select
a,b,c from names like 'MICHAEL%'" approach?
that it has a table object. Basically, it allows users to do silly
things and tries to convert it into intelligent queries. Using other
components, I would try to avoid table objects unless the table is
really small.
I'm using query objects. The locate method is implemented and
functional, but I am afraid that on such a big table the searches
wouldn't be something to be proud of.
I'm testing MDO (Mercury Database Objects). Pretty much like IBX, but
oriented to Firebird and Opensource.
Ok, thanks. I'll give it a try.
Thanks
Andrew
> Secondly, using locate is generally a bad idea, LIKE can be used insome cases, but is likely to not use any index (in your case an index
could be used, whereas if you used a parameter rather than a
constant, no index would be used), whereas STARTING [WITH] normally
uses an index if available.
Ok, and if I'm building the queries on-the-fly and using the "select
a,b,c from names like 'MICHAEL%'" approach?
> > Does table.locate(...) does a search and drags all the records bySorry, I should have written query.locate. Old habit.
> > wire to the workstation untill the position of this 'MICHAEL%' guy?
> > Or does a select make it work faster?
> I think that will vary with your choice of tool. IBObjects only hascursors and queries (for use in selecting datasets), but may fake
that it has a table object. Basically, it allows users to do silly
things and tries to convert it into intelligent queries. Using other
components, I would try to avoid table objects unless the table is
really small.
I'm using query objects. The locate method is implemented and
functional, but I am afraid that on such a big table the searches
wouldn't be something to be proud of.
I'm testing MDO (Mercury Database Objects). Pretty much like IBX, but
oriented to Firebird and Opensource.
> > Is there another (aka better) way to do these kind of searches?OK and a query if bidirectional access is neccessary.
>You ought to use SELECT, using a cursor if unidirectional access is
Ok, thanks. I'll give it a try.
> > Using FB 1.5.1.I think too. :-)
>
> Good choice!
Thanks
Andrew