Grokbase
x

Re: Bitmap Heap scan 8.1/8.2

View PostFlat  Thread  Threaded | < Prev - Next >
Martin Marques Re: [GENERAL] Bitmap Heap scan 8.1/8.2
| +1 vote
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
Pavel Stehule wrote:
> 2007/10/22, Martin Marques <martin@bugs.unl.edu.ar>:
>> Pavel Stehule wrote:
>>> 2007/10/22, Martin Marques <martin@bugs.unl.edu.ar>:
>>>> Pavel Stehule wrote:
>>>>> Hello
>>>>>
>>>>> I am unsure, did you check config values?
>>>> Don't know which ones you are talking about, but all enable_* are set to on.
>>>>
>>>> Anything else?
>>>>
>>> shared_buffers
>> 8.1:
>>
>>   16000
> ~ 128M
>>
>> 8.2:
>>
>>   400MB
>>
>>
>>> work_mem
>> 8.1:
>>
>>   8192
> 8M !!!! 8>4
>> 8.2:
>>
>>   4MB
>>
>>
>>> effective_cache_size
>> 8.1:
>>
>>   1000
> 8M
>> 8.2:
>>
>>   128MB
>>
>>
>
> try
>
> set work_mem to '8MB';
> and
> explain analyze select ..

These things didn't help. What changed the plan completely was this:

seq_page_cost = 5.0                     # measured on an arbitrary scale
cpu_tuple_cost = 0.05                   # same scale as above

Specially the first one. Now I get this:

explain analyze SELECT usuarios,nticket,objeto,vencimiento FROM
prestamos WHERE biblioteca = 19 AND  vencimiento < now() AND NOT 
devuelto ORDER BY vencimiento DESC;

QUERY PLAN
--------------------------------------------------------------------------------------------------------------------------------------------------------
  Sort  (cost=7058.86..7060.86 rows=800 width=20) (actual 
time=22.850..22.888 rows=95 loops=1)
    Sort Key: vencimiento
    ->  Index Scan using prestamos_objetos_devuelto_idx on prestamos 
(cost=0.00..7020.28 rows=800 width=20) (actual time=0.346..22.590
rows=95 loops=1)
          Index Cond: (devuelto = false)
          Filter: ((biblioteca = 19) AND (vencimiento < now()) AND (NOT 
devuelto))
  Total runtime: 22.973 ms


--
  21:50:04 up 2 days,  9:07,  0 users,  load average: 0.92, 0.37, 0.18
---------------------------------------------------------
Lic. Martín Marqués         |   SELECT 'mmarques' ||
Centro de Telemática        |       '@' || 'unl.edu.ar';
Universidad Nacional        |   DBA, Programador,
     del Litoral             |   Administrador
---------------------------------------------------------

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Thread : Bitmap Heap scan 8.1/8.2
1)
Martin Marques I have to PG servers, one ver. 8.1.9 and the other 8.2.4. I was checking a query out and found that...
2)
Pavel Stehule Hello I am unsure, did you check config values? Pavel 2007/10/22, Martin Marques...
3)
Martin Marques Don't know which ones you are talking about, but all enable_* are set to on. Anything else?
4)
Pavel Stehule 2007/10/22, Martin Marques <martin@bugs.unl.edu.ar>: shared_buffers work_mem effective_cache_size...
5)
t...@fuzzy.cz Well, the cost_* values might be interesting too. That is seq_page_cost random_page_cost...
6)
Martin Marques siprebi-1.4=> SHOW enable_seqscan ; enable_seqscan off siprebi-1.4=> explain analyze SELECT...
7)
Martin Marques 400MB 4MB 128MB...
8)
Pavel Stehule 2007/10/22, Martin Marques <martin@bugs.unl.edu.ar>: ~ 128M 8M !!!! 8>4 8M try set work_mem to...
9)
Martin Marques These things didn't help. What changed the plan completely was this: seq_page_cost = 5.0 # measured...
10)
Martin Marques Martin Marques escribió: Can someone explain how this parameters are measured? What is 5.0 in this...
11)
Pavel Stehule 2007/10/23, Martin Marques <martin@bugs.unl.edu.ar>:...
12)
Alvaro Herrera Martin Marques escribió: It's an arbitrary number, based on which all the other numbers are...
13)
Tom Lane It's also worth pointing out that having seq_page_cost > random_page_cost is simply not sane, and...
14)
Martin Marques Now that I read more intensively he docs I see that all the cost parameters are related one with...
15)
Tom Lane I'd guess the other way round: cheaper disks are likely to have worse seek speeds, which translates...
spacer
View PostFlat  Thread  Threaded | < Prev - Next >