The unnecessary use of BIGint is not enough to explain the sluggishness. Let's look for other issues.
Does that "key" icon mean that there is an index on id
? Perchance is it PRIMARY KEY
?
What ENGINE
is in use? If it is MyISAM, then you have the drawback of the PK not being 'clustered' with the data, thereby making the 10K lookups slower.
What will you do with 10K rows? Think of the networks costs. And the memory costs in the client.
But maybe this is the real problem... If this is InnoDB, and if the TEXT
columns are "big", then the values are stored "off record". This leads to another disk hit to get any big text values. Change them to some realistic max len of VARCHAR(...)
.
How much RAM do you have? What is the value of innodb_buffer_pool_size
? Did you time the query twice? (The first time would be I/O-bound; the second might be hitting cache. How big (in MB or GB) is the table?