weird behaviour - Mailing list pgsql-general

From matthieuclavier@mageos.com
Subject weird behaviour
Date
Msg-id 20010830123419.A16194@po.reynerie.com
Whole thread Raw
Responses Re: weird behaviour  (matthieuclavier@mageos.com)
List 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

pgsql-general by date:

Previous
From: Shanmugasundaram
Date:
Subject: Re: Fw: [JDBC] Regarding vacuumdb
Next
From: matthieuclavier@mageos.com
Date:
Subject: Re: weird behaviour