I'm sorry for the title, I don't know how to clearly summarize the problem.
That's probably why I couldn't find an answer when searching by myself.
Feel free to improve it.
Anyways, let's say I have a query returning primary id's.
SELECT id FROM ...
Instead of having results presented with one row for each id like this:
id
-----
1
2
3
45
182
183
184
I would like to know if there's any access to some internal state based on the index that would return this:
ranges
---------
1-3
45
182-184
The whole point here is NOT to have a nice presentation, I can do that.
Besides it would add a treatment after having run the query, I want the opposite.
I'd like to know if it exists some king of shortcut that would accelerate the query by not having to return each row individually. Maybe something related to extracting data directly from the indexes used in the WHERE clause.
I'm not aware of a generic SQL way to do that but I would love to know if there's some postgres feature for this.
If the answer is "no", it's ok. I just had to ask...