Author |
Message
|
In_love_with_MQ |
Posted: Wed Aug 30, 2006 5:55 pm Post subject: time taken to clear queue |
|
|
Acolyte
Joined: 10 Jul 2005 Posts: 70
|
I have a queue A with 200000 persistent messages of 32 kb size each
I have q queue B with 200 persistent messages of 32 kb size each
when i say CLEAR Q on both it takes the same time to clear the queue . 5 seconds ..
I was expecting Queue A clearing would take more time .
why is that both takes same time to clear . |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Aug 30, 2006 6:30 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
CLEAR QUEUE just resets pointers to the data in the q file. It doesn't physically remove each individual message - it just resets the storage.
Basically, what it means is... the people who wrote the code behind CLEAR QUEUE knew what they were doing and turned what a naive programmer would make an O(N) operation into an O(1) operation. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
In_love_with_MQ |
Posted: Wed Aug 30, 2006 10:02 pm Post subject: thanks jeff |
|
|
Acolyte
Joined: 10 Jul 2005 Posts: 70
|
hi jeff ,
Thanks for the knowledge .
Just 1 more doubt . So if clear Queue does not remove physically . Then how this physical files are cleaned . |
|
Back to top |
|
 |
kevinf2349 |
Posted: Thu Aug 31, 2006 4:51 am Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
They aren't, they don't need to be. They will get reused.
If you need to 'physically' remove the queue then that is totally different. CLEAR QUEUE only 'removes' messages from a queue, it doesn't dlete the queue. |
|
Back to top |
|
 |
HubertKleinmanns |
Posted: Thu Aug 31, 2006 6:37 am Post subject: Re: thanks jeff |
|
|
 Shaman
Joined: 24 Feb 2004 Posts: 732 Location: Germany
|
In_love_with_MQ wrote: |
hi jeff ,
Thanks for the knowledge .
Just 1 more doubt . So if clear Queue does not remove physically . Then how this physical files are cleaned . |
MQ clears the messages physically sometime, when it has time. You cannot force the physical deletion of the queue contents. _________________ Regards
Hubert
Last edited by HubertKleinmanns on Thu Aug 31, 2006 6:47 am; edited 1 time in total |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Aug 31, 2006 6:39 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Actually, I believe that other people here have seen that CLEAR QUEUE does free up the space in the q file.
I'm sure this is because it resets the pointer for the end of the file to point to the head of the file... Because, you see, the people who wrote the code... _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
HubertKleinmanns |
Posted: Thu Aug 31, 2006 6:50 am Post subject: |
|
|
 Shaman
Joined: 24 Feb 2004 Posts: 732 Location: Germany
|
jefflowrey wrote: |
Actually, I believe that other people here have seen that CLEAR QUEUE does free up the space in the q file.
I'm sure this is because it resets the pointer for the end of the file to point to the head of the file... Because, you see, the people who wrote the code... |
I saw both - and only MQ (and maybe the developers ) know it exactly. _________________ Regards
Hubert |
|
Back to top |
|
 |
|