postgres=# explain analyze select count(*) from test;
NOTICE: QUERY PLAN:
Aggregate (cost=4281.06..4281.06 rows=1 width=0) (actual time=606.31..606.31 rows=1 loops=1)
-> Seq Scan on test (cost=0.00..4031.05 rows=100005 width=0) (actual time=0.09..461.49 rows=100005 loops=1)
Total runtime: 606.43 msec
EXPLAIN
postgres=# explain analyze select count(*) from test;
NOTICE: QUERY PLAN:
Aggregate (cost=4281.06..4281.06 rows=1 width=0) (actual time=605.08..605.08 rows=1 loops=1)
-> Seq Scan on test (cost=0.00..4031.05 rows=100005 width=0) (actual time=0.09..460.71 rows=100005 loops=1)
Total runtime: 605.21 msec
EXPLAIN
postgres=# select count(*) from test;
count
--------
100005
(1 row)
postgres=#
위와같이 나오면 빠른건가요?
-- 김상기 님이 쓰신 글:
>> explain aanlyze 쿼리문
>>
>> 이런 방식이 7.2.x 버전부터 지원하기 시작했습니다.
>>
>> 그 이전 버전을 사용하신다면, 그 수행시간에 대한 조회는 다른 프로그램을 이용해야겠지요. unix 에서의 time 같은것.
>>
>>
>> -- 이경직 님이 쓰신 글:
>> >> 예를 들어서
>> >>
>> >> select * from ta order by f1;
>> >>
>> >> 이라는 쿼리를 날렸을 때...
>> >>
>> >> 쿼리를 수행하고 났을 때... 시간이 얼만큼 걸렸는지 알고 싶은데...
>> >>
>> >> 그걸 알아낼 수 있는 방법은 없나요?
|