Subject Re: How to mix ascending and descending fields in one index
Author kokok_kokok
Martijn,

I have received 2 reponses:

1) Using the "Natural" plan, but it is not a solution. It is the problem that I have. I cannot use a natural plan in a database with millions of rows.

2) Using a computed index. Yes, this is the solution that I will use, but it is "artificial" solution to avoid the problem of creating a mixed index, my desired and clean solution. I wanted to know how to create a mixed index in FB, but I guess that it is not possible.

In any case, thank you, I will use the second solution.





--- In firebird-support@yahoogroups.com, "Martijn Tonies" <m.tonies@...> wrote:
>
> Hi,
>
> > No, of course not. Sorry for my english.
> > I only transfer 30 records to the client software in each block.
> > When the user click "Next Page", then I transfer 30 more.
>
> This still means you potentially transfer millions of records, or so you
> say.
>
> What user wants to do that?
>
> > As I said, it works very fine if I do "order by a, b". FB uses the index
> > in the plan and the response is really fast.
> >
> >
> > My problem is that my query should be "order by a desc, b", and I do not
> > know the way to define this specific index.
> >
> > I need that FB uses a index when the order is (a desc, b) because the
> > proposed solution, read the entire table and then ordering it, it is
> > inviable for the time consuming.
> >
>
> You've had several answer to that particular index question already, why
> do you continu to ignore them? You cannot define such an index.
>
>
> With regards,
>
> Martijn Tonies
> Upscene Productions
> http://www.upscene.com
>
> Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
> Anywhere, MySQL, InterBase, NexusDB and Firebird!
>
> Database questions? Check the forum:
> http://www.databasedevelopmentforum.com
>