I have table with 35 millions rows. When I select rows as shown as that was not working and It takes a long time and eventually gives a memory error (my ram is 32GB).
I partitioned the table based on the monthly date and I have 64 table as shown as
But query not working again and It takes a long time and eventually gives a memory error . How can I do solve this problem?
This is basically your query:
This is basically a full table scan, so I don't see why it would run out of member. The exception is the correlated subquery. For that, you need an index on
studentIndex(family, name_ship)
-- and to be sure that the columns are of the same time (otherwise, the index may not be used).Your
length
andwidth
comparisons look an awful lot like geographic coordinates. I might also suggest a GIS solution. However, if those are latitudes and longitudes, the area is pretty big, so GIS might not really be that helpful.