weird behaviour

From: matthieuclavier(at)mageos(dot)com
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: weird behaviour
Date: 2001-08-30 10:34:20
Message-ID: 20010830123419.A16194@po.reynerie.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

hi,

i'm notice a weird behaviour while running a query on the same table,
the query take a long time to be executed when this table is empty ,
and when this table isn't empty, it take about 1/2 second ....
the two tables are freshly vacuumed ...

here the same tables, one is empty, not the other :

Table "classement_jeu"
Attribute | Type | Modifier
-----------+----------+----------
semaine | smallint |
annee | integer |
id_turf | integer |
points | integer |
tag | smallint |

Table "classement_jeumat"
Attribute | Type | Modifier
-----------+----------+----------
semaine | smallint |
annee | integer |
id_turf | integer |
points | integer |
tag | smallint |

psql -c "select count(*) from classement_jeu"
count
-------
21318
(1 row)

psql "select count(*) from classement_jeumat"
count
-------
0
(1 row)

now the query i want to run :

SELECT id_turf
FROM classement_jeumat
WHERE semaine = 35
AND annee = 2001
AND id_turf IN (5247,5425, ....)

the IN clause contain about 600 entries ....

run the query on table classement_jeumat (empty table)

time psql < laquery
id_turf
---------
(0 rows)

real 1m18.308s
user 0m0.000s
sys 0m0.015s

run the query on table classement_jeu (not empty table)

time psql < laquery
id_turf
---------
[... snip results ... ]
(592 rows)

real 0m0.472s
user 0m0.009s
sys 0m0.014s

somebody understand what happened ?

it's not really important because i will not work on an empty
table ... but i'm surprised ...

thanxs

mat

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Wong Ka Ho Matthew 2001-08-30 10:39:54 [Revoke] cannot revoke the permission of "some User"....
Previous Message Shanmugasundaram 2001-08-30 10:07:32 Re: Fw: [JDBC] Regarding vacuumdb