Alright! Just wanted to know how limit works here - How limit is showing the different output
postgres=# select * from bint order by a[2] desc limit 5; a --------------- {14} {10} {14} {10,14,10,10} <-- It comes prior to 5th record and consistently whereas " select * from bint order by a[2] desc;" showing something else consistently. {10,14,14,14} (5 rows)
If you read the documentation https://www.postgresql.org/docs/8.3/queries-order.html you will see that nulls first is the default for desc. What you are seeing is the rows with nulls first and they can appear in any order as you have only ordered by [2] which these rows don't have. add nulls last after desc to get the order you want.