Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > Strange statist...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 15715 of 17437
Post > Topic >>

Strange statistics

by henke@[EMAIL PROTECTED] (Henrik) Jun 3, 2008 at 03:44 PM

Hi list,

I'm having a table with a lots of file names in it. (Aprox 3 million)  
in a 8.3.1 db.

Doing this simple query shows that the statistics is way of but I can  
get them right even when I raise the statistics to 1000.

db=# alter table tbl_file alter file_name set statistics 1000;
ALTER TABLE
db=# analyze tbl_file;
ANALYZE
db=# explain analyze select * from tbl_file where lower(file_name)  
like lower('to%');
                                                          QUERY PLAN
----------------------------------------------------------------------------------------------------------------------------
  Bitmap Heap Scan on tbl_file  (cost=23.18..2325.13 rows=625  
width=134) (actual time=7.938..82.386 rows=17553 loops=1)
    Filter: (lower((file_name)::text) ~~ 'to%'::text)
    ->  Bitmap Index Scan on tbl_file_idx  (cost=0.00..23.02 rows=625  
width=0) (actual time=6.408..6.408 rows=17553 loops=1)
          Index Cond: ((lower((file_name)::text) ~>=~ 'to'::text) AND  
(lower((file_name)::text) ~<~ 'tp'::text))
  Total runtime: 86.230 ms
(5 rows)


How can it be off by a magnitude of 28??

Cheers,
Henke

-- 
Sent via pgsql-general mailing list (pgsql-general@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
 




 3 Posts in Topic:
Strange statistics
henke@[EMAIL PROTECTED]   2008-06-03 15:44:13 
Re: Strange statistics
joris@[EMAIL PROTECTED]   2008-06-03 23:31:26 
Re: Strange statistics
henke@[EMAIL PROTECTED]   2008-06-05 09:32:42 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 12:21:11 CST 2008.