Subject Re: [firebird-support] Is there something like an Indexed View or indexed Computed Column?
Author Jorge
Svein Erling Tysvær wrote:
> Seeing the query, view and index definitions (so that we know which
> fields are involved) and the plan normally helps quite a bit. Also, it
> would be good to know which version of Firebird you're using and how
> selective the indexes in the fields are. And how many rows does your
> query return?

I put this up on stackoverflow, I hope it's OK if I link over there.
That shows the schema example.

The PLAN for that SELECT query looks like this:


The main big table "data" has about 1.2 billion rows and the "data_set"
table has about 800 million rows. I was wrong about the result set size
in my stackoverflow post, the result set varies but is usually around 10
million rows (it can be more but not on average).

If I run the query without ORDER BY then it starts returning results
quickly. When I add the ORDER BY Firebird starts filling the temporary
filesystem with a huge amount of data and it takes forever to run.