Re: PostgreSQL does CAST implicitely between int and adomain derived from int

От: Kevin Grittner
Тема: Re: PostgreSQL does CAST implicitely between int and adomain derived from int
Дата: ,
Msg-id: 4A964B66020000250002A3D8@gw.wicourts.gov
(см: обсуждение, исходный текст)
Ответ на: Re: PostgreSQL does CAST implicitely between int and a domain derived from int  (Jean-Michel Pouré)
Ответы: Re: PostgreSQL does CAST implicitely between int and adomain derived from int  (Jean-Michel Pouré)
Список: pgsql-performance

Скрыть дерево обсуждения

Re: PostgreSQL does CAST implicitely between int and a domain derived from int  ("Kevin Grittner", )
 Re: PostgreSQL does CAST implicitely between int and a domain derived from int  ("Kevin Grittner", )
  Re: PostgreSQL does CAST implicitely between int and a domain derived from int  (Jean-Michel Pouré, )
   Re: PostgreSQL does CAST implicitely between int and adomain derived from int  ("Kevin Grittner", )
    Re: PostgreSQL does CAST implicitely between int and adomain derived from int  (Jean-Michel Pouré, )
     Re: PostgreSQL does CAST implicitely between int andadomain derived from int  ("Kevin Grittner", )
      Re: PostgreSQL does CAST implicitely between int andadomain derived from int  (Jean-Michel Pouré, )
       Re: PostgreSQL does CAST implicitely between int and a domain derived from int  ("Kevin Grittner", )
        Re: PostgreSQL  (Jean-Michel Pouré, )
        Re: PostgreSQL does CAST implicitely between int and a domain derived from int  (Robert Haas, )
         Re: PostgreSQL does CAST implicitely between int and a domain derived from int  (Tom Lane, )
          Re: PostgreSQL does CAST implicitely between int and a domain derived from int  (Jean-Michel Pouré, )
           Re: PostgreSQL does CAST implicitely between int and a domain derived from int  (Bruce Momjian, )
            Re: PostgreSQL does CAST implicitely between int and a domain derived from int  (Jean-Michel Pouré, )
             Re: PostgreSQL does CAST implicitely between int and a domain derived from int  (Tom Lane, )
              Re: PostgreSQL does CAST implicitely between int and a domain derived from int  (Jean-Michel Pouré, )
               Re: PostgreSQL does CAST implicitely between int and a domain derived from int  (Tom Lane, )
                Re: PostgreSQL does CAST implicitely between int and a domain derived from int  (Greg Stark, )
         Re: PostgreSQL does CAST implicitely between int and a domain derived from int  (Jean-Michel Pouré, )
 Re: PostgreSQL does CAST implicitely between int and a domain derived from int  (Jean-Michel Pouré, )
  Re: PostgreSQL does CAST implicitely between int and adomain derived from int  ("Kevin Grittner", )
   Re: PostgreSQL does CAST implicitely between int and adomain derived from int  (Jean-Michel Pouré, )

Jean-Michel Pouré<> wrote:
> Still casting.

For about the tenth time on the topic -- YOUR PROBLEM HAS NOTHING
WHATSOEVER TO DO WITH CASTING!  Let that go so you can look for the
real problem.

Just as an example, look at this closely:

test=# create table t2 (c1 int not null primary key);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
"t2_pkey" for table "t2"
CREATE TABLE
test=# insert into t2 select * from generate_series(1,10000);
INSERT 0 10000
test=# vacuum analyze;
VACUUM
test=# explain analyze select count(*) from t1 where c1 between 200
and 400;
                                                      QUERY PLAN
----------------------------------------------------------------------
-------------------------------------------------
 Aggregate  (cost=12.75..12.76 rows=1 width=0) (actual
time=0.764..0.765 rows=1 loops=1)
   ->  Index Scan using t1_pkey on t1  (cost=0.00..12.25 rows=200
width=0) (actual time=0.095..0.470 rows=201 loops=1)
         Index Cond: (((c1)::integer >= 200) AND ((c1)::integer <=
400))
 Total runtime: 0.827 ms
(4 rows)

The type is always put in there so that you can see what it's doing;
it doesn't reflect anything which is actually taking any time.

Let it go.

-Kevin


В списке pgsql-performance по дате сообщения:

От: gael@pilotsystems.net (Gaël Le Mignot)
Дата:
Сообщение: Re: Performance regression between 8.3 and 8.4 on heavy text indexing
От: Guillaume Smet
Дата:
Сообщение: Re: Performance regression between 8.3 and 8.4 on heavy text indexing