Search Postgresql Archives

Re: Optimizing projections containing unused columns

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



not so smart yet ;)

thickbook:~ gj$ psql gj
Timing is on.
psql (8.4devel)
Type "help" for help.

gj=# create table smartarse(id bigserial, v varchar not null , primary key (id, v));
NOTICE:  CREATE TABLE will create implicit sequence "smartarse_id_seq" for serial column "smartarse.id"
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "smartarse_pkey" for table "smartarse"
CREATE TABLE
Time: 172,315 ms
gj=# \d+ smartarse
                                           Table "public.smartarse"
 Column |       Type        |                       Modifiers                        | Storage  | Description 
--------+-------------------+--------------------------------------------------------+----------+-------------
 id     | bigint            | not null default nextval('smartarse_id_seq'::regclass) | plain    | 
 v      | character varying | not null                                               | extended | 
Indexes:
    "smartarse_pkey" PRIMARY KEY, btree (id, v)
Has OIDs: no

gj=# insert into smartarse(v) values('one'), ('two'), ('three'), ('four');
INSERT 0 4
Time: 1,500 ms
gj=# explain select count(*) from smartarse where v is null;
                           QUERY PLAN                           
----------------------------------------------------------------
 Aggregate  (cost=21.62..21.63 rows=1 width=0)
   ->  Seq Scan on smartarse  (cost=0.00..21.60 rows=6 width=0)
         Filter: (v IS NULL)
(3 rows)

Time: 1,115 ms


but, getting more and more smart - that's for sure :)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux