1

Not crucial question here, just curiosity.

I am inserting data via multiple scripts in a base running in PostgreSQL.

I wanted to test the time requested to end the insert, so I requested many times the number of lines in the table as follow :

SELECT COUNT(*) FROM "table";

I noticed that everytime the number of line is following a schema : last digits (hundreds, tens and units) are the same as the firsts (millions and thousands).

By example :

  • if there was around 39k lines, the number of lines returned was 39039,
  • if there was around 8518k lines, the number of lines returned was 8526518 (8518000 + 8518)

Any idea from where it come? Is it by default? or maybe a personal config?


More info :

  • Same behaviour on psql.

  • I am adding 1k inserts by connection to the base, so I don't think it's related.

  • When the inserts are over, the correct number of lines is returned.

  • I did enought requests to ensure that's not coincidence.

  • I am working on Windows.

5
+50

I am adding 1k inserts by connection to the base, so I don't think it's related.

I think it is related. You are probably adding exactly 1001 rows in each batch.

All these numbers are multiples of 1001.

  • Ahah just under my nose... gj. (in 23h, you got the reward) – Yohann V. Apr 22 '15 at 14:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.