Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 12374
Latest: LevelLord
New This Month: 1
New This Week: 2
New Today: 0
Stats
Total Posts: 40212
Total Topics: 7082
Most Online Today: 68
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 60
Total: 60

Author Topic: search entire gallery setting ?  (Read 3415 times)

0 Members and 1 Guest are viewing this topic.

Offline spikeweb

  • Newbie
  • *
  • Posts: 38
    • View Profile
search entire gallery setting ?
« on: June 20, 2011, 08:23:56 am »
I checked the forum but did not find an answer. Is there a way to prevent users to search the entire gallery ?

I actually have a gallery with 10000+ images and from time to time, the web server has to handle a long request. The last one is :

Code: [Select]
Query_time: 381
Lock_time: 0
Rows_sent: 10626
Rows_examined: 120771768

SELECT
                               COUNT(*) as total
                       FROM (forum1_gallery_pic as p, forum1_gallery_comment as com)

               LEFT JOIN forum1_members AS m  ON (m.ID_MEMBER = p.ID_MEMBER)
               LEFT JOIN forum1_gallery_usersettings AS s ON (s.ID_MEMBER = m.ID_MEMBER)
               LEFT JOIN forum1_gallery_log_mark_view AS v ON (p.ID_PICTURE = v.ID_PICTURE AND v.ID_MEMBER = 25659 AND v.user_id_cat = p.USER_ID_CAT)
                                       WHERE ((s.private =0 || s.private IS NULL ) AND (s.password = '' || s.password IS NULL ) AND p.USER_ID_CAT !=0 AND p.a
pproved =1) || (p.approved =1 AND p.USER_ID_CAT =0)   AND com.ID_PICTURE = p.ID_PICTURE GROUP BY p.ID_PICTURE;

I wonder how to prevent a guest user/registered user to start search a search.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15106
    • View Profile
Re: search entire gallery setting ?
« Reply #1 on: June 20, 2011, 08:32:36 am »
That query from above is not from search but from the "recentcomments" index display box on the gallery index

If you can do a quick test for me see how long this one takes
Code: [Select]
SELECT
                               COUNT(*) as total
                       FROM (forum1_gallery_pic as p, forum1_gallery_comment as com)

               LEFT JOIN forum1_members AS m  ON (m.ID_MEMBER = p.ID_MEMBER)
               LEFT JOIN forum1_gallery_usersettings AS s ON (s.ID_MEMBER = m.ID_MEMBER)
               LEFT JOIN forum1_gallery_log_mark_view AS v ON (p.ID_PICTURE = v.ID_PICTURE AND v.ID_MEMBER = 25659 AND v.user_id_cat = p.USER_ID_CAT)
                                       WHERE com.ID_PICTURE = p.ID_PICTURE AND ((s.private =0 || s.private IS NULL ) AND (s.password = '' || s.password IS NULL ) AND p.USER_ID_CAT !=0 AND p.a
pproved =1) || (p.approved =1 AND p.USER_ID_CAT =0)   GROUP BY p.ID_PICTURE;

If you need to code to disable the search let me know along with the SMF version used
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline spikeweb

  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: search entire gallery setting ?
« Reply #2 on: June 20, 2011, 08:54:03 am »
I just ran the query from phpMyAdmin as the previous one was read in the server log :

SELECT COUNT( * ) AS total
FROM (
forum1_gallery_pic AS p, forum1_gallery_comment AS com
)
LEFT JOIN forum1_members AS m ON ( m.ID_MEMBER = p.ID_MEMBER )
LEFT JOIN forum1_gallery_usersettings AS s ON ( s.ID_MEMBER = m.ID_MEMBER )
LEFT JOIN forum1_gallery_log_mark_view AS v ON ( p.ID_PICTURE = v.ID_PICTURE
AND v.ID_MEMBER =25659
AND v.user_id_cat = p.USER_ID_CAT )
WHERE com.ID_PICTURE = p.ID_PICTURE
AND (
(
s.private =0 || s.private IS NULL
)
AND (
s.password = '' || s.password IS NULL
)
AND p.USER_ID_CAT !=0
AND p.approved =1
) || ( p.approved =1
AND p.USER_ID_CAT =0 )
GROUP BY p.ID_PICTURE
LIMIT 0 , 30


The answer is : Affichage des lignes 0 - 29 (1 620 total, Traitement en 9.3797 sec.)

in english : display for lines 0 - 29 (1 620 in total, execution time 9.3797 sec.)

did it help ??

Gallery version is 3.0.22

Offline spikeweb

  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: search entire gallery setting ?
« Reply #3 on: June 20, 2011, 08:56:31 am »
oopppss, just realized that phpMyAdmin allows only 30 results to be displayed.

I can ask my server admin to run the full query ...

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15106
    • View Profile
Re: search entire gallery setting ?
« Reply #4 on: June 20, 2011, 09:06:17 am »
What SMF Version are you using going to try something
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline spikeweb

  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: search entire gallery setting ?
« Reply #5 on: June 20, 2011, 09:09:06 am »
SMF is 1.1.14

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15106
    • View Profile
Re: search entire gallery setting ?
« Reply #6 on: June 20, 2011, 09:18:32 am »
It was actually the listall feature for the recent comments block.

Made a couple changes copy this file to your sources folder and let me know if it helps
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline spikeweb

  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: search entire gallery setting ?
« Reply #7 on: June 20, 2011, 11:02:18 am »
Here is the result of the query as requested :

# Query_time: 29  Lock_time: 0  Rows_sent: 1611  Rows_examined: 23626208

Will check your file and let you know ... :)

 

Related Topics

  Subject / Started by Replies Last post
2 Replies
3491 Views
Last post August 06, 2007, 09:34:02 pm
by rumboogy
1 Replies
2450 Views
Last post February 25, 2009, 10:47:25 pm
by SMFHacks
2 Replies
2853 Views
Last post May 27, 2012, 07:05:37 pm
by VinnyH
2 Replies
1651 Views
Last post December 19, 2014, 08:08:57 am
by Jonas1975
1 Replies
1720 Views
Last post December 29, 2016, 10:09:18 am
by SMFHacks

+- Recent Topics

Download System Lite by Rock Lee
June 03, 2020, 07:34:24 pm

Font question by SMFHacks
May 27, 2020, 08:15:26 am

Error message with latest SMF 2.1 Github build by Hatshepsut
May 25, 2020, 01:43:26 am

smfblog not working on 2.0.17 by tech9
May 20, 2020, 01:44:34 pm

Copyright removal by stbc
May 18, 2020, 01:27:57 am

Mod Verified User i can't square the image by Rock Lee
May 07, 2020, 07:56:10 pm

SMF4Mobile 2.0 released for SMF 2.0.x by SMFHacks
May 06, 2020, 12:13:14 pm

SMF Social Login Pro - Discontinued? by Nicole
May 02, 2020, 05:47:04 pm

Likes by SMFHacks
April 30, 2020, 09:50:35 pm

Upgrade Issue - by SMFHacks
April 28, 2020, 12:40:13 pm

Powered by EzPortal