Update of /cvsroot/monetdb/sql/src/test/BugTracker-2009/Tests
In directory 
sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv29141/src/test/BugTracker-2009/Tests

Added Files:
        use_order_column_first.SF-2686008.sql 
Log Message:
propagated changes of Friday Nov 20 2009 - Saturday Nov 28 2009
from the Nov2009 branch to the development trunk

  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2009/11/20 - nielsnes:
          
src/test/BugTracker-2009/Tests/use_order_column_first.SF-2686008.sql,1.1.2.1
  new optimizer to fix (performance) bug. We should always start grouping with
  a sorted column (if its part of a group by list).
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


--- NEW FILE: use_order_column_first.SF-2686008.sql ---
-- A table with unsorted values in a and b
create table unsorted (a int,b int);
insert into unsorted values (2, 3);
insert into unsorted values (1, 2);
insert into unsorted values (4, 1);
insert into unsorted values (3, 2);
insert into unsorted values (2, 3);
insert into unsorted values (3, 3);
insert into unsorted values (3, 1);
insert into unsorted values (4, 3);

-- Store it in a new table with tuples sorted on a,b
create table sorted (a int, b int);
insert into sorted
select * from unsorted
order by a,b;

select * from sorted;

-- these tho are semantically equivalent (the group by attributes are swapped)
plan select a,b from sorted group by a,b;
plan select a,b from sorted group by b,a;

drop table unsorted;
drop table sorted;


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to