IEEE 802.11ah is a new Wi-Fi draft for sub-1Ghz communications, aiming to address the major challenges of the Internet of Things (IoT): connectivity among a large number of power-constrained stations deployed over a wide area. The new Restricted Access Window (RAW) mechanism promises to increase throughput and energy efficiency by dividing stations into different RAW groups. Only the stations in the same group can access the channel simultaneously, which reduces collision probability in dense scenarios. However, the draft does not specify any RAW grouping algorithms, while the grouping strategy is expected to severely impact RAW performance. To study the impact of parameters such as traffic load, number of stations and RAW group duration on optimal number of RAW groups, we implemented a sub-1Ghz PHY model and the 802.11ah MAC protocol in ns-3 to evaluate its transmission range, throughput, latency and energy efficiency in dense IoT network scenarios. The simulation shows that, with appropriate grouping, the RAW mechanism substantially improves throughput, latency and energy efficiency. Furthermore, the results suggest that the optimal grouping strategy depends on many parameters, and intelligent RAW group adaptation is necessary to maximize performance under dynamic conditions. This paper provides a major leap towards such a strategy.