Re: Slow query with a lot of data
От | Moritz Onken |
---|---|
Тема | Re: Slow query with a lot of data |
Дата | |
Msg-id | 0BFF9855-F1FA-4A83-B8B2-622D7CE69F77@houseofdesign.de обсуждение исходный текст |
Ответ на | Re: Slow query with a lot of data (Matthew Wakeling <matthew@flymine.org>) |
Ответы |
Re: Slow query with a lot of data
|
Список | pgsql-performance |
>> > > Well, you're getting the database to read the entire contents of the > domain_categories table in order. That's 12 million rows - a fair > amount of work. > > You may find that removing the "user = 1337" constraint doesn't make > the query much slower - that's where you get a big win by clustering > on domain. You might also want to cluster the results table on domain. Running the query for more than one user is indeed not much slower. That's what I need. I'm clustering the results table on domain right now. But why is this better than clustering it on "user"? > > > If you want the results for just one user, it would be very helpful > to have a user column on the domain_categories table, and an index > on that column. However, that will slow down the query for all users > a little. A row in domain_categories can belong to more than one user. But I don't need to run this query for only one user anyway. Thanks so far,
В списке pgsql-performance по дате отправления: