Re: Help on query plan. (was: select like and indexes) - Mailing list pgsql-general

From William N. Zanatta
Subject Re: Help on query plan. (was: select like and indexes)
Date
Msg-id 3E2D3569.9080106@veritel.com.br
Whole thread Raw
In response to Re: Help on query plan. (was: select like and indexes)  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Responses Re: Help on query plan. (was: select like and indexes)
List pgsql-general
>
> Okay, this shows that you are already in "C" locale, since otherwise it
> wouldn't try it at all.  Have you done a vacuum analyze recently?
> What does vacuum analyze verbose tbl_access; give you?

   I don't remember the exactly time I did it, but I run just vacuum
yesterday. Anyway here goes my vacuum analyze result:

access=# vacuum analyze verbose tbl_access;
INFO:  --Relation public.tbl_access--
INFO:  Pages 27595: Changed 0, Empty 0; Tup 1193987: Vac 0, Keep 0,
UnUsed 34276.
         Total CPU 1.78s/1.68u sec elapsed 3.51 sec.
INFO:  Analyzing public.tbl_access
VACUUM

access=# explain analyze select * from tbl_access where ip like '12%157';
                                                     QUERY PLAN
--------------------------------------------------------------------
  Seq Scan on tbl_access  (cost=0.00..42519.84 rows=136 width=133)
(actual time=646.06..20478.91 rows=1391 loops=1)
    Filter: (ip ~~ '12%157'::text)
  Total runtime: 20482.46 msec
(3 rows)

>
> The real rows and estimated rows seem far enough off that it might be
> getting confused as to which plan is best.
>
>
   yes, I see that. :(

   I set enable_seqscan = off yesterday and got the results I was
expecting. Would it be expensive to leave it disabled?

william




--
Perl combines all of the worst aspects of BASIC, C and line noise.
                 -- Keith Packard


pgsql-general by date:

Previous
From: Adam Witney
Date:
Subject: Re: readline configure error again
Next
From: "Boget, Chris"
Date:
Subject: Good (introductory) book