Slow insert when table is almost "full". IBM Informix call 376023

Ask a Question related to Informix, Design and Development.

  1. #1

    Default Slow insert when table is almost "full". IBM Informix call 376023

    IDS 9.21 FC4 on HP-UX 11.11

    We had a problem with a slow-running process twice on two months. On each
    occasion, we could see that the rate of insert into a particular table was
    abnormally slow. We could also see that, in each case, the number of used
    pages was equal to the number of allocated ones.

    The working hypothesis is that the engine is spending a long time looking
    for small quantities of free space within the existing pages. This is a
    table that is added to daily, then older rows purged monthly. But we'd
    never had this problem previously in several years of running, nor did the
    number of extents (34 in the first occurrence, 4 in the second) seem of
    significance, nor have we had any problems with any of the other 600-odd
    tables taking new extents.

    Following a restore to a test system I was able to reproduce the problem in
    "lab"conditions: a simple INSERT INTO runs at around 4000 inserts per minute
    when the table is nearly
    full: if rebuilt (ALTER FRAGMENT ... INIT IN) the inserts then run at
    128,000 inserts per minute. So the insert rate is more than 30 times slower
    when the problem is being experienced.

    The table itself is only about 3GBytes in size, but is in a database server
    of about 400GBytes. Unfortunately, the problem cannot be reproduced by an
    onunload/onload (the insert rate is normal following this, which may itself
    give useful clues), so it can only be investigated with a lot of set-up
    effort [no free EMC BCVs available :((]

    I reproduce the first part of an oncheck -pt for the affected table below.
    As mentioned, if the table is rebuilt, the inserts immediately run at their
    normal rate.

    Any ideas gratefully ridiculed :-)

    thanks
    Neil

    TBLspace Report for live:root.dsinvlines

    Physical Address e00014
    Creation date 07/12/2003 19:38:14
    TBLspace Flags 802 Row Locking
    TBLspace use 4 bit bit-maps
    Maximum row size 219
    Number of special columns 0
    Number of keys 0
    Number of extents 4
    Current serial value 1
    First extent size 4
    Next extent size 500000
    Number of pages allocated 1500004
    Number of pages used 1500004
    Number of data pages 1430215
    Number of rows 12871602
    Partition partnum 9437201
    Partition lockid 9437201


    Neil Truby Guest

  2. Similar Questions and Discussions

    1. "Can't call method "disconnect" on an undefined value..."
      Hey there anyone, I am new at this and I am trying to figure this out and I don't know too much, but I keep getting this error when trying to run...
    2. "Continual Scroller" insert into Table Cel
      CS3 Mac http://www.cbrc.us I am trying to insert by drag&drop a vertical Continuous Scroller Library Item into a table cell. But, the preview...
    3. #39657 [Opn]: The extended table-specification "database.table" creates errors
      ID: 39657 User updated by: w dot kaiser at fortune dot de Reported By: w dot kaiser at fortune dot de Status: Open...
    4. Slow insert when table is almost "full". IBM Informix call
      Yes .. You are right. We do experience the same issue on a daily basis when we try to delete some of the rows or all the rows and insert new rows...
    5. "save", "selective color" menu go too slow. Please help!
      have intel pentium 4 cpu and photoshop 7. when im using "selective color" or "save" menu (im a novice of photoshop), i have to wait kind of long...
  3. #2

    Default Re: Slow insert when table is almost "full". IBM Informix call 376023

    I'm surprised that no-one clever has responded yet. I'll state some
    blindingly obvious things for you to ridicule...

    I guess this is a simple table, with no blobs/etc.

    I also guess there is no intentional fragmentation.

    Is the indexing simple? Is it possible to remove the indexes when it's
    going slow and see if that helps. Does the fabled 'update stats' help at
    all in that case?

    If your hypothesis is correct, then wouldn't the deletion of rows at the
    end of the month result in large blocks becoming available. Of course
    if, over time, you add (numerically) more rows in successive months,
    then fragmentation will start to happen as time goes by...

    If you are fragmenting on date, is that working correctly?

    Is there any insert trigger being fired when these rows go in?

    Is the insert going straight into the table, or via a view?

    Any CHECK constraints?

    So, there's the obvious things done...

    Yes, I'd agree that your hypothesis looks reasonable, but wonder whether
    it's data or index fragmentation that may be responsible. Maybe you can
    pursue this in your lab? If you can get it a bit repeatable, then
    perhaps you could try some things before you get to loading the data in.

    Good luck, I can't see this being a fast thing to debug, if only because
    of the quantities of data involved and the non-repeatability of it.

    A suggestion for testing in the lab, if you can do it, would be to 'dd'
    the dbspace before trying anything, then at least you can get back to a
    known state.



    In message <bjg81r$i58fo$1@ID-162943.news.uni-berlin.de>, Neil Truby
    <neil.truby@ardenta.com> writes
    >IDS 9.21 FC4 on HP-UX 11.11
    >
    >We had a problem with a slow-running process twice on two months. On each
    >occasion, we could see that the rate of insert into a particular table was
    >abnormally slow. We could also see that, in each case, the number of used
    >pages was equal to the number of allocated ones.
    >
    >The working hypothesis is that the engine is spending a long time looking
    >for small quantities of free space within the existing pages. This is a
    >table that is added to daily, then older rows purged monthly. But we'd
    >never had this problem previously in several years of running, nor did the
    >number of extents (34 in the first occurrence, 4 in the second) seem of
    >significance, nor have we had any problems with any of the other 600-odd
    >tables taking new extents.
    >
    >Following a restore to a test system I was able to reproduce the problem in
    >"lab"conditions: a simple INSERT INTO runs at around 4000 inserts per minute
    >when the table is nearly
    >full: if rebuilt (ALTER FRAGMENT ... INIT IN) the inserts then run at
    >128,000 inserts per minute. So the insert rate is more than 30 times slower
    >when the problem is being experienced.
    >
    >The table itself is only about 3GBytes in size, but is in a database server
    >of about 400GBytes. Unfortunately, the problem cannot be reproduced by an
    >onunload/onload (the insert rate is normal following this, which may itself
    >give useful clues), so it can only be investigated with a lot of set-up
    >effort [no free EMC BCVs available :((]
    >
    >I reproduce the first part of an oncheck -pt for the affected table below.
    >As mentioned, if the table is rebuilt, the inserts immediately run at their
    >normal rate.
    >
    >Any ideas gratefully ridiculed :-)
    >
    >thanks
    >Neil
    >
    >TBLspace Report for live:root.dsinvlines
    >
    > Physical Address e00014
    > Creation date 07/12/2003 19:38:14
    > TBLspace Flags 802 Row Locking
    > TBLspace use 4 bit bit-maps
    > Maximum row size 219
    > Number of special columns 0
    > Number of keys 0
    > Number of extents 4
    > Current serial value 1
    > First extent size 4
    > Next extent size 500000
    > Number of pages allocated 1500004
    > Number of pages used 1500004
    > Number of data pages 1430215
    > Number of rows 12871602
    > Partition partnum 9437201
    > Partition lockid 9437201
    >
    >
    --
    Andrew Lennard [email]andy@kontron.demon.co.uk[/email]
    Andy Lennard Guest

  4. #3

    Default Re: Slow insert when table is almost "full". IBM Informix call 376023

    "Andy Lennard" <andy@kontron.demon.co.uk> wrote in message
    news:qNvFE8JIFIX$EwY7@kontron.demon.co.uk...
    > I'm surprised that no-one clever has responded yet.
    You have, Andy. Oh, I see what you mean ... :-)
    > I guess this is a simple table, with no blobs/etc.
    Yes.
    > I also guess there is no intentional fragmentation.
    Yes, that's right, there isn't.
    > Is the indexing simple? Is it possible to remove the indexes when it's
    > going slow and see if that helps. Does the fabled 'update stats' help at
    > all in that case?
    Hmmm. Indexing is simple. I haven't tried dropping one. I doubt if it'll
    make any difference, because the indexes are detatched. Update stats?
    Well, Mark Denham suggested an "update statistcis low", and he's clever, so
    I'll try that too ....

    > If your hypothesis is correct, then wouldn't the deletion of rows at the
    > end of the month result in large blocks becoming available. Of course
    > if, over time, you add (numerically) more rows in successive months,
    > then fragmentation will start to happen as time goes by...
    You'd have thought so. The 2nd occurrence occurred only six weeks after
    we'd rebuilt the table following the first occurrence.
    > If you are fragmenting on date, is that working correctly?
    n/a
    > Is there any insert trigger being fired when these rows go in?
    No.
    > Is the insert going straight into the table, or via a view?
    Direct to a table.
    > Any CHECK constraints?
    No, only a primary (and therefore unique) key
    > Yes, I'd agree that your hypothesis looks reasonable, but wonder whether
    > it's data or index fragmentation that may be responsible. Maybe you can
    > pursue this in your lab? If you can get it a bit repeatable, then
    > perhaps you could try some things before you get to loading the data in.
    Indeed. I'd suspect data, since the problem seems to coincide with the
    number of pages allocated being equal to the number used, as per the oncheck
    output. But who knows ...?
    > A suggestion for testing in the lab, if you can do it, would be to 'dd'
    > the dbspace before trying anything, then at least you can get back to a
    > known state.
    You reckon? Only by dropping all the other application dbspaces first I'd
    have thought ... and even then it's timestamps would be out of step with
    rootdbs, llogdbs, physdbs etc ....

    Thanks for stimulating my mind, I'll let you know how your suggestions go.

    cheers
    Neil


    Neil Truby Guest

  5. #4

    Default Re: Slow insert when table is almost "full". IBM Informix call 376023


    Neil,
    I'm thinking as I write:-

    I think the problem comes from the way that Informix re-uses deleted
    records.
    I assume the table has a fixed record sixe of 219 bytes. That means there
    are 9 rows/page.
    That gives a total row size for the table with 1500004 pages of 13500036
    rows. So you are trying to re-use the 13500036 - 12871602 deleted rows
    which are dotted around over the allocated pages. So,when you insert a new
    row you have to search for it which could mean reading lots of pages.
    However, when the table is re-org'd all of the free pages are together,
    there aren't any free rows, and therefore you don't have to look for them.
    I have seen similar effects on many tables. And the problem gets worse over
    time. If my memory serves me right I had a similar performance problem with
    SE back in about 1988. This is why many applications which work like this
    will unload the remaining records at month end, drop the table, and then
    recreate it, before reloading the records. However with 12 million rows
    this could be time consuming.

    What do the other "gurus" think?

    Malcolm

    ----- Original Message -----
    From: "Neil Truby" <neil.truby@ardenta.com>
    To: <informix-list@iiug.org>
    Sent: Monday, September 08, 2003 4:07 PM
    Subject: Re: Slow insert when table is almost "full". IBM Informix call
    376023

    > "Andy Lennard" <andy@kontron.demon.co.uk> wrote in message
    > news:qNvFE8JIFIX$EwY7@kontron.demon.co.uk...
    > > I'm surprised that no-one clever has responded yet.
    >
    > You have, Andy. Oh, I see what you mean ... :-)
    >
    > > I guess this is a simple table, with no blobs/etc.
    > Yes.
    >
    > > I also guess there is no intentional fragmentation.
    > Yes, that's right, there isn't.
    >
    > > Is the indexing simple? Is it possible to remove the indexes when it's
    > > going slow and see if that helps. Does the fabled 'update stats' help at
    > > all in that case?
    >
    > Hmmm. Indexing is simple. I haven't tried dropping one. I doubt if
    it'll
    > make any difference, because the indexes are detatched. Update stats?
    > Well, Mark Denham suggested an "update statistcis low", and he's clever,
    so
    > I'll try that too ....
    >
    >
    > > If your hypothesis is correct, then wouldn't the deletion of rows at the
    > > end of the month result in large blocks becoming available. Of course
    > > if, over time, you add (numerically) more rows in successive months,
    > > then fragmentation will start to happen as time goes by...
    >
    > You'd have thought so. The 2nd occurrence occurred only six weeks after
    > we'd rebuilt the table following the first occurrence.
    >
    > > If you are fragmenting on date, is that working correctly?
    > n/a
    >
    > > Is there any insert trigger being fired when these rows go in?
    > No.
    >
    > > Is the insert going straight into the table, or via a view?
    > Direct to a table.
    >
    > > Any CHECK constraints?
    > No, only a primary (and therefore unique) key
    >
    > > Yes, I'd agree that your hypothesis looks reasonable, but wonder whether
    > > it's data or index fragmentation that may be responsible. Maybe you can
    > > pursue this in your lab? If you can get it a bit repeatable, then
    > > perhaps you could try some things before you get to loading the data in.
    >
    > Indeed. I'd suspect data, since the problem seems to coincide with the
    > number of pages allocated being equal to the number used, as per the
    oncheck
    > output. But who knows ...?
    >
    > > A suggestion for testing in the lab, if you can do it, would be to 'dd'
    > > the dbspace before trying anything, then at least you can get back to a
    > > known state.
    >
    > You reckon? Only by dropping all the other application dbspaces first I'd
    > have thought ... and even then it's timestamps would be out of step with
    > rootdbs, llogdbs, physdbs etc ....
    >
    > Thanks for stimulating my mind, I'll let you know how your suggestions go.
    >
    > cheers
    > Neil
    >
    >
    sending to informix-list
    malcolm.iiug Guest

  6. #5

    Default Re: Slow insert when table is almost "full". IBM Informix call 376023

    Neil Truby wrote:
    > Thanks for stimulating my mind
    That's funny...

    Obnoxio The Clown Guest

  7. #6

    Default Re: Slow insert when table is almost "full". IBM Informix call 376023

    > Hmmm. Indexing is simple. I haven't tried dropping one. I doubt if
    it'll
    > make any difference, because the indexes are detatched. Update stats?
    > Well, Mark Denham suggested an "update statistcis low", and he's clever,
    so
    > I'll try that too ....
    >
    Hmmm. Cheques in the post.

    sending to informix-list
    Mark Denham Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139