Why doesn't maxItems (the parameter of QueryPropertyHistory) work properly?
Intuitively, if you set maxItems to 10, then you only expect up to 10 rows back from the service. In my experience, the number of rows returned is about four times whatever I set maxItems to. In a simple empirical test, I tried a variety of values of maxItems for the same timeframe, and here's what I got back:
| maxItems | Rows returned |
|---|---|
| 1 | 4 |
| 2 | 8 |
| 3 | 12 |
| 4 | 16 |
| 5 | 19 |
| 6 | 22 |
| 7 | 25 |
Furthermore, I would expect as I increase maxItems, I would simply get additional rows with a later time; this too is not what happens. I always get new rows with each increase of maxItems, but they aren't all later in time! I've summarised this below:
| timestamp | First value of maxItems where timestamp is seen |
|---|---|
| 2016-11-23 01:00:00.224 | 1 |
| 2016-11-23 01:00:00.226 | 1 |
| 2016-11-23 01:00:00.231 | 1 |
| 2016-11-23 01:01:00.180 | 2 |
| 2016-11-23 01:01:00.182 | 2 |
| 2016-11-23 01:01:00.184 | 1 |
| 2016-11-23 01:01:00.186 | 2 |
| 2016-11-23 01:02:00.224 | 3 |
| 2016-11-23 01:02:00.227 | 3 |
| 2016-11-23 01:02:00.230 | 3 |
| 2016-11-23 01:03:00.161 | 4 |
| 2016-11-23 01:03:00.164 | 4 |
| 2016-11-23 01:03:00.168 | 4 |
| 2016-11-23 01:04:00.173 | 5 |
| 2016-11-23 01:04:00.175 | 5 |
| 2016-11-23 01:04:00.179 | 5 |
| 2016-11-23 01:05:00.132 | 6 |
| 2016-11-23 01:05:00.135 | 6 |
| 2016-11-23 01:05:00.138 | 6 |
| 2016-11-23 01:06:00.130 | 7 |
| 2016-11-23 01:06:00.132 | 7 |
| 2016-11-23 01:06:00.135 | 7 |
| 2016-11-23 01:09:00.136 | 2 |
| 2016-11-23 01:16:00.220 | 3 |
| 2016-11-23 01:24:00.157 | 4 |
Unless I'm missing something fundamental, maxItems really doesn't work properly!
PS - I've seen a post by Pat Nash related to this, but it doesn't address exactly what's going on with maxItems!

