In order to store images in a SQL Server database, I am working with a naive table. The table's columns are: ImageID, X, Y, value
.
Table sample data:
[1 1 1 255] %first image, pixel (1,1)
[1 1 2 100] %first image, pixel (1,2)
[1 2 1 100] %first image, pixel (2,1)
[1 2 2 0]
[2 1 1 100] %second image, pixel (1,1)
[2 1 2 10]
I choose this specific way for storing images for executing queries such as:
select count(value)
from myTable
where myTable.x = 10 and myTable.y = 15 and myTable.value > 10
The problem is that I am running out of storage - the table is getting too big. Do you have any suggestion for saving images more efficiently while maintaining the ability to executes queries like the mentioned above?
Thanks.