On Sat, May 10, 2014 at 3:03 AM, Molnár Attila <amol...@mve.hu> wrote:

>
>
>
> *Optimization II. *    - temporal indexing of materialization : e.g. when
> ORDER/GROUP BY has no index then currently the whole resultset is
> materialized, and the sorting moves the whole row each time. Instead of
> this it should create a temporal index on the order/group columns then
> fetching on the temporal index. In this way much less writes needed. This
> shold be applied after a treshold : common sense sais after index size/row
> size rate is smaller than 0.5.
>

Just to reemphasize what Vlad said earlier:

1) When data is retrieved for a sorted query, Firebird retrieves only the
sort key and any columns that are referenced, not the whole record.

2) For large record sets, Firebird uses a two-level sort.  Initially, it
uses an in-memory quick sort, moving pointers, not records.  When the
sorted data reaches the limit of the in-memory sort buffer, the data is
written to a sort temp file in the desired key order.  When all the data to
be sorted has been read, Firebird merges the data in the sort temp files.

So, no, sorting does not move the whole row each time.  Not the whole row,
not each time.

Good luck,

Ann
------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to