Divide a star catalogue to optimize star search I'm continue working on my Planetarium software and I have a doubt.

At this moment my star catalogue is very small, but I'm planning to use a bigger one. To optimize the search inside this catalogue I think I have to divide it in regions.

These regions will be delimited by right ascension and declination.

Using stars' right ascension and declination, how can I divide the sky to optimize my search?

I want to retrieve all stars visible at this moment. Maybe not all of them, only the visible by the user. For example, if user is looking to the North, he/she won't see the stars at the South. The region will be the area visible by the user at this moment, and I want to get all stars for that given region using also a limit magnitude.
This is really a computing problem, but I suppose the only point from an astronomical perspective is what the RA, Dec distributions of your catalogues look like.

I'm not that familiar with optimal search techniques but I guess that you want roughly similar numbers of stars in each region.

If your catalogue is just of the brightest stars, then these are fairly uniformly distributed around the sky, so splitting them up in equal bands of right ascension would probably do.

However, if you are dealing with much larger catalogues then there is likely to be a significant concentration towards the galactic plane. In these circumstance you might be better off splitting your regions in terms of their galactic latitude. So you would calculate galactic coordinates by transforming the RA, Dec and then plot the distribution of number of stars versus galactic latitude to see where you would split your regions.