Member Avatar for westmeadboy

I have a table with about 150,000 rows. The table never changes and the rows are physically ordered by one of the columns. That column is the only column I ever need to query against.

The values (TEXT) in that column are not distinct.

Creating an index on this column would bloat the database so I'm looking into ways to avoid this.

Seeing as the rows are already ordered an index seems unnecessary.

Is there any way to write the query efficiently in this case where there is no index?

Recommended Answers

All 2 Replies

Ummm, bit of a discussion area this one.

You don't _have_ to have an index on the column you test against. But it will improve performance if you do. As for the storage overhead, disk is cheap, but people get very annoyed when their queries are slow, and they tend to shout a lot.

Member Avatar for westmeadboy

Unfortunately, in this case, the database size is important (developing for mobile device) and also creating an index is time-consuming...

So, I'm wondering if there is a way to do an efficient query without an index.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.