Re: Optimizing projections containing unused columns - Mailing list pgsql-general

From Grzegorz Jaśkiewicz
Subject Re: Optimizing projections containing unused columns
Date
Msg-id 2f4958ff0810161051v4822aedbhee8b30a9761236c0@mail.gmail.com
Whole thread Raw
In response to Re: Optimizing projections containing unused columns  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: Optimizing projections containing unused columns  ("Andrus" <kobruleht2@hot.ee>)
List pgsql-general
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 :)

pgsql-general by date:

Previous
From: Ivan Sergio Borgonovo
Date:
Subject: Re: ssl woes after 8.1 -> 8.3 update
Next
From: "Andrus"
Date:
Subject: Re: Optimizing projections containing unused columns