~aglenyoung/+junk/postgres-9.3-dtrace

« back to all changes in this revision

Viewing changes to src/test/regress/expected/union.out

  • Committer: Package Import Robot
  • Author(s): Martin Pitt, Christoph Berg, Martin Pitt
  • Date: 2013-06-26 15:13:32 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20130626151332-p34yjpn0txbdsdzd
Tags: 9.3~beta2-1
[ Christoph Berg ]
* hurd-i386: Ignore testsuite failures so we have a working libpq5 (they
  don't implement semaphores so the server won't even start).
* Mark postgresql-9.3 as beta in the description, suggested by Joshua D.
  Drake.

[ Martin Pitt ]
* New upstream release 9.3 beta2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
515
515
   ->  Seq Scan on tenk1 b
516
516
(2 rows)
517
517
 
 
518
-- Test that we push quals into UNION sub-selects only when it's safe
 
519
explain (costs off)
 
520
SELECT * FROM
 
521
  (SELECT 1 AS t, 2 AS x
 
522
   UNION
 
523
   SELECT 2 AS t, 4 AS x) ss
 
524
WHERE x < 4;
 
525
                 QUERY PLAN                 
 
526
--------------------------------------------
 
527
 Unique
 
528
   ->  Sort
 
529
         Sort Key: (1), (2)
 
530
         ->  Append
 
531
               ->  Result
 
532
               ->  Result
 
533
                     One-Time Filter: false
 
534
(7 rows)
 
535
 
 
536
SELECT * FROM
 
537
  (SELECT 1 AS t, 2 AS x
 
538
   UNION
 
539
   SELECT 2 AS t, 4 AS x) ss
 
540
WHERE x < 4;
 
541
 t | x 
 
542
---+---
 
543
 1 | 2
 
544
(1 row)
 
545
 
 
546
explain (costs off)
 
547
SELECT * FROM
 
548
  (SELECT 1 AS t, generate_series(1,10) AS x
 
549
   UNION
 
550
   SELECT 2 AS t, 4 AS x) ss
 
551
WHERE x < 4
 
552
ORDER BY x;
 
553
           QUERY PLAN           
 
554
--------------------------------
 
555
 Sort
 
556
   Sort Key: ss.x
 
557
   ->  Subquery Scan on ss
 
558
         Filter: (ss.x < 4)
 
559
         ->  HashAggregate
 
560
               ->  Append
 
561
                     ->  Result
 
562
                     ->  Result
 
563
(8 rows)
 
564
 
 
565
SELECT * FROM
 
566
  (SELECT 1 AS t, generate_series(1,10) AS x
 
567
   UNION
 
568
   SELECT 2 AS t, 4 AS x) ss
 
569
WHERE x < 4
 
570
ORDER BY x;
 
571
 t | x 
 
572
---+---
 
573
 1 | 1
 
574
 1 | 2
 
575
 1 | 3
 
576
(3 rows)
 
577
 
 
578
explain (costs off)
 
579
SELECT * FROM
 
580
  (SELECT 1 AS t, (random()*3)::int AS x
 
581
   UNION
 
582
   SELECT 2 AS t, 4 AS x) ss
 
583
WHERE x > 3;
 
584
                                 QUERY PLAN                                 
 
585
----------------------------------------------------------------------------
 
586
 Subquery Scan on ss
 
587
   Filter: (ss.x > 3)
 
588
   ->  Unique
 
589
         ->  Sort
 
590
               Sort Key: (1), (((random() * 3::double precision))::integer)
 
591
               ->  Append
 
592
                     ->  Result
 
593
                     ->  Result
 
594
(8 rows)
 
595
 
 
596
SELECT * FROM
 
597
  (SELECT 1 AS t, (random()*3)::int AS x
 
598
   UNION
 
599
   SELECT 2 AS t, 4 AS x) ss
 
600
WHERE x > 3;
 
601
 t | x 
 
602
---+---
 
603
 2 | 4
 
604
(1 row)
 
605