![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I'm trying to tune this application where we're seeing something like 65% of temp tables wind up getting created on disk. We're using a lot of queries of the form: SELECT COUNT(*) FROM table1 WHERE ((field1 = 478 AND field2 = 2815) OR (field1 = 2815 AND field2 = 478)) Note that table1 has a TEXT column in it. Will the COUNT(*) cause the temp table to be created on disk? Should we instead do something like COUNT(id)? |
|
Thanks. |
#3
| |||
| |||
|
|
postmaster (AT) cjc (DOT) org wrote: Hi, I'm trying to tune this application where we're seeing something like 65% of temp tables wind up getting created on disk. We're using a lot of queries of the form: SELECT COUNT(*) FROM table1 WHERE ((field1 = 478 AND field2 = 2815) OR (field1 = 2815 AND field2 = 478)) Note that table1 has a TEXT column in it. Will the COUNT(*) cause the temp table to be created on disk? Should we instead do something like COUNT(id)? Have you tried creating an index like: create index i1 on table1 (field1,field2); |
#4
| |||
| |||
|
|
Yes, those fields have indexes on them already. |
#5
| |||
| |||
|
|
In article <1158899368.955665.296060 (AT) e3g2000cwe (DOT) googlegroups.com>, toby <toby (AT) telegraphics (DOT) com.au> wrote: postmaster (AT) cjc (DOT) org wrote: Hi, I'm trying to tune this application where we're seeing something like 65% of temp tables wind up getting created on disk. We're using a lot of queries of the form: SELECT COUNT(*) FROM table1 WHERE ((field1 = 478 AND field2 = 2815) OR (field1 = 2815 AND field2 = 478)) Note that table1 has a TEXT column in it. Will the COUNT(*) cause the temp table to be created on disk? Should we instead do something like COUNT(id)? Have you tried creating an index like: create index i1 on table1 (field1,field2); Yes, those fields have indexes on them already. |
![]() |
| Thread Tools | |
| Display Modes | |
| |