Re: Help on query plan. (was: select like and indexes)

From: "William N(dot) Zanatta" <william(at)veritel(dot)com(dot)br>
To: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Help on query plan. (was: select like and indexes)
Date: 2003-01-21 11:56:25
Message-ID: 3E2D3569.9080106@veritel.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Schlegel 2003-01-21 12:03:08 Re: TEXT / INTEGER problem in function
Previous Message Adam Witney 2003-01-21 10:10:26 Re: readline configure error again