| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | Mats Lofkvist <mal(at)algonet(dot)se> |
| Cc: | pgsql-general(at)postgreSQL(dot)org |
| Subject: | Re: Planner estimates cost of 'like' a lot lower than '='?? |
| Date: | 2001-07-22 22:52:39 |
| Message-ID: | 8869.995842359@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Mats Lofkvist <mal(at)algonet(dot)se> writes:
> I just did a quick test before going to bed but 7.2devel seems
> do to what we want:
> testdb=> select count(*) from data where value like 'test_0';
> count
> -------
> 9
> (1 row)
> testdb=> explain select count(*) from data where value like 'test_0';
> NOTICE: QUERY PLAN:
> Aggregate (cost=5581.45..5581.45 rows=1 width=0)
> -> Seq Scan on data (cost=0.00..5580.69 rows=306 width=0)
> EXPLAIN
> testdb=> select count(*) from data where value >= 'test' and value < 'tesu';
> count
> -------
> 10000
> (1 row)
> testdb=> explain select count(*) from data where value >= 'test' and value < 'tesu';
> NOTICE: QUERY PLAN:
> Aggregate (cost=6007.24..6007.24 rows=1 width=0)
> -> Seq Scan on data (cost=0.00..5986.02 rows=8487 width=0)
> EXPLAIN
Those estimates do look a lot closer to reality, all right. And the
join plan is the right thing now. Excellent...
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Lee Harr | 2001-07-22 22:57:43 | Re: Copy and serial type problem |
| Previous Message | Mats Lofkvist | 2001-07-22 22:45:02 | Re: Planner estimates cost of 'like' a lot lower than '='?? |